• Home
  • Raw
  • Download

Lines Matching refs:co

99     PyCodeObject *co;  in PyCode_New()  local
120 co = PyObject_NEW(PyCodeObject, &PyCode_Type); in PyCode_New()
121 if (co != NULL) { in PyCode_New()
122 co->co_argcount = argcount; in PyCode_New()
123 co->co_nlocals = nlocals; in PyCode_New()
124 co->co_stacksize = stacksize; in PyCode_New()
125 co->co_flags = flags; in PyCode_New()
127 co->co_code = code; in PyCode_New()
129 co->co_consts = consts; in PyCode_New()
131 co->co_names = names; in PyCode_New()
133 co->co_varnames = varnames; in PyCode_New()
135 co->co_freevars = freevars; in PyCode_New()
137 co->co_cellvars = cellvars; in PyCode_New()
139 co->co_filename = filename; in PyCode_New()
141 co->co_name = name; in PyCode_New()
142 co->co_firstlineno = firstlineno; in PyCode_New()
144 co->co_lnotab = lnotab; in PyCode_New()
145 co->co_zombieframe = NULL; in PyCode_New()
146 co->co_weakreflist = NULL; in PyCode_New()
148 return co; in PyCode_New()
275 PyObject *co = NULL; in code_new() local
332 co = (PyObject *)PyCode_New(argcount, nlocals, stacksize, flags, in code_new()
341 return co; in code_new()
345 code_dealloc(PyCodeObject *co) in code_dealloc() argument
347 Py_XDECREF(co->co_code); in code_dealloc()
348 Py_XDECREF(co->co_consts); in code_dealloc()
349 Py_XDECREF(co->co_names); in code_dealloc()
350 Py_XDECREF(co->co_varnames); in code_dealloc()
351 Py_XDECREF(co->co_freevars); in code_dealloc()
352 Py_XDECREF(co->co_cellvars); in code_dealloc()
353 Py_XDECREF(co->co_filename); in code_dealloc()
354 Py_XDECREF(co->co_name); in code_dealloc()
355 Py_XDECREF(co->co_lnotab); in code_dealloc()
356 if (co->co_zombieframe != NULL) in code_dealloc()
357 PyObject_GC_Del(co->co_zombieframe); in code_dealloc()
358 if (co->co_weakreflist != NULL) in code_dealloc()
359 PyObject_ClearWeakRefs((PyObject*)co); in code_dealloc()
360 PyObject_DEL(co); in code_dealloc()
364 code_repr(PyCodeObject *co) in code_repr() argument
371 if (co->co_firstlineno != 0) in code_repr()
372 lineno = co->co_firstlineno; in code_repr()
373 if (co->co_filename && PyString_Check(co->co_filename)) in code_repr()
374 filename = PyString_AS_STRING(co->co_filename); in code_repr()
375 if (co->co_name && PyString_Check(co->co_name)) in code_repr()
376 name = PyString_AS_STRING(co->co_name); in code_repr()
379 name, co, filename, lineno); in code_repr()
384 code_compare(PyCodeObject *co, PyCodeObject *cp) in code_compare() argument
387 cmp = PyObject_Compare(co->co_name, cp->co_name); in code_compare()
389 cmp = co->co_argcount - cp->co_argcount; in code_compare()
391 cmp = co->co_nlocals - cp->co_nlocals; in code_compare()
393 cmp = co->co_flags - cp->co_flags; in code_compare()
395 cmp = co->co_firstlineno - cp->co_firstlineno; in code_compare()
397 cmp = PyObject_Compare(co->co_code, cp->co_code); in code_compare()
399 cmp = PyObject_Compare(co->co_consts, cp->co_consts); in code_compare()
401 cmp = PyObject_Compare(co->co_names, cp->co_names); in code_compare()
403 cmp = PyObject_Compare(co->co_varnames, cp->co_varnames); in code_compare()
405 cmp = PyObject_Compare(co->co_freevars, cp->co_freevars); in code_compare()
407 cmp = PyObject_Compare(co->co_cellvars, cp->co_cellvars); in code_compare()
549 PyCodeObject *co, *cp; in code_richcompare() local
569 co = (PyCodeObject *)self; in code_richcompare()
572 eq = PyObject_RichCompareBool(co->co_name, cp->co_name, Py_EQ); in code_richcompare()
574 eq = co->co_argcount == cp->co_argcount; in code_richcompare()
576 eq = co->co_nlocals == cp->co_nlocals; in code_richcompare()
578 eq = co->co_flags == cp->co_flags; in code_richcompare()
580 eq = co->co_firstlineno == cp->co_firstlineno; in code_richcompare()
582 eq = PyObject_RichCompareBool(co->co_code, cp->co_code, Py_EQ); in code_richcompare()
586 consts1 = _PyCode_ConstantKey(co->co_consts); in code_richcompare()
599 eq = PyObject_RichCompareBool(co->co_names, cp->co_names, Py_EQ); in code_richcompare()
601 eq = PyObject_RichCompareBool(co->co_varnames, cp->co_varnames, Py_EQ); in code_richcompare()
603 eq = PyObject_RichCompareBool(co->co_freevars, cp->co_freevars, Py_EQ); in code_richcompare()
605 eq = PyObject_RichCompareBool(co->co_cellvars, cp->co_cellvars, Py_EQ); in code_richcompare()
628 code_hash(PyCodeObject *co) in code_hash() argument
631 h0 = PyObject_Hash(co->co_name); in code_hash()
633 h1 = PyObject_Hash(co->co_code); in code_hash()
635 h2 = PyObject_Hash(co->co_consts); in code_hash()
637 h3 = PyObject_Hash(co->co_names); in code_hash()
639 h4 = PyObject_Hash(co->co_varnames); in code_hash()
641 h5 = PyObject_Hash(co->co_freevars); in code_hash()
643 h6 = PyObject_Hash(co->co_cellvars); in code_hash()
646 co->co_argcount ^ co->co_nlocals ^ co->co_flags; in code_hash()
699 PyCode_Addr2Line(PyCodeObject *co, int addrq) in PyCode_Addr2Line() argument
701 int size = PyString_Size(co->co_lnotab) / 2; in PyCode_Addr2Line()
702 unsigned char *p = (unsigned char*)PyString_AsString(co->co_lnotab); in PyCode_Addr2Line()
703 int line = co->co_firstlineno; in PyCode_Addr2Line()
717 _PyCode_CheckLineNumber(PyCodeObject* co, int lasti, PyAddrPair *bounds) in _PyCode_CheckLineNumber() argument
722 p = (unsigned char*)PyString_AS_STRING(co->co_lnotab); in _PyCode_CheckLineNumber()
723 size = PyString_GET_SIZE(co->co_lnotab) / 2; in _PyCode_CheckLineNumber()
726 line = co->co_firstlineno; in _PyCode_CheckLineNumber()