Generated by Cython 0.29.23
Yellow lines hint at Python interaction.
Click on a line that starts with a "+
" to see the C code that Cython generated for it.
Raw output: opcode_metric.c
+01: import types
__pyx_t_1 = __Pyx_Import(__pyx_n_s_types, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_types, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
02: from cpython.object cimport PyObject_HasAttr
03: from py_pal.data_collection.metric cimport CallMetric
04: from py_pal.data_collection.arguments cimport unpack_oparg
+05: from py_pal.data_collection.metric import AvgBuiltinFuncComplexity
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_AvgBuiltinFuncComplexity); __Pyx_GIVEREF(__pyx_n_s_AvgBuiltinFuncComplexity); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_AvgBuiltinFuncComplexity); __pyx_t_2 = __Pyx_Import(__pyx_n_s_py_pal_data_collection_metric, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_AvgBuiltinFuncComplexity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_AvgBuiltinFuncComplexity, __pyx_t_1) < 0) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
06:
+07: from py_pal.util import setup_logging
__pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_setup_logging); __Pyx_GIVEREF(__pyx_n_s_setup_logging); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_setup_logging); __pyx_t_1 = __Pyx_Import(__pyx_n_s_py_pal_util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_setup_logging); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setup_logging, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
08:
+09: logger = setup_logging(__name__)
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_setup_logging); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_logger, __pyx_t_3) < 0) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10:
+11: cdef class OpcodeMetric:
struct __pyx_vtabstruct_6py_pal_15data_collection_13opcode_metric_OpcodeMetric { Py_ssize_t (*get_value)(struct __pyx_obj_6py_pal_15data_collection_13opcode_metric_OpcodeMetric *, PyFrameObject *); Py_ssize_t (*get_function_opcodes)(struct __pyx_obj_6py_pal_15data_collection_13opcode_metric_OpcodeMetric *, PyObject *, PyObject *, PyObject *); int (*in_complexity_map)(struct __pyx_obj_6py_pal_15data_collection_13opcode_metric_OpcodeMetric *, PyObject *); void (*report)(struct __pyx_obj_6py_pal_15data_collection_13opcode_metric_OpcodeMetric *, int __pyx_skip_dispatch); float (*pct)(struct __pyx_obj_6py_pal_15data_collection_13opcode_metric_OpcodeMetric *, Py_ssize_t, Py_ssize_t); }; static struct __pyx_vtabstruct_6py_pal_15data_collection_13opcode_metric_OpcodeMetric *__pyx_vtabptr_6py_pal_15data_collection_13opcode_metric_OpcodeMetric;
12: """Base opcode metric."""
13:
+14: def __init__(self):
/* Python wrapper */ static int __pyx_pw_6py_pal_15data_collection_13opcode_metric_12OpcodeMetric_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6py_pal_15data_collection_13opcode_metric_12OpcodeMetric___init__[] = "`builtin_calls` counts calls to Python builtin functions. `hits` indicates how many builtin calls were\n weighted by a function from :class:`py_pal.data_collection.AvgBuiltinFuncComplexity`.\n "; #if CYTHON_COMPILING_IN_CPYTHON struct wrapperbase __pyx_wrapperbase_6py_pal_15data_collection_13opcode_metric_12OpcodeMetric___init__; #endif static int __pyx_pw_6py_pal_15data_collection_13opcode_metric_12OpcodeMetric_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; __pyx_r = __pyx_pf_6py_pal_15data_collection_13opcode_metric_12OpcodeMetric___init__(((struct __pyx_obj_6py_pal_15data_collection_13opcode_metric_OpcodeMetric *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6py_pal_15data_collection_13opcode_metric_12OpcodeMetric___init__(struct __pyx_obj_6py_pal_15data_collection_13opcode_metric_OpcodeMetric *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; }
15: """`builtin_calls` counts calls to Python builtin functions. `hits` indicates how many builtin calls were
16: weighted by a function from :class:`py_pal.data_collection.AvgBuiltinFuncComplexity`.
17: """
+18: self.hits = 0
__pyx_v_self->hits = 0;
+19: self.builtin_calls = 0
__pyx_v_self->builtin_calls = 0;
+20: self.sum_opcodes = 0
__pyx_v_self->sum_opcodes = 0;
21:
+22: def __str__(self):
/* Python wrapper */ static PyObject *__pyx_pw_6py_pal_15data_collection_13opcode_metric_12OpcodeMetric_3__str__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6py_pal_15data_collection_13opcode_metric_12OpcodeMetric_3__str__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); __pyx_r = __pyx_pf_6py_pal_15data_collection_13opcode_metric_12OpcodeMetric_2__str__(((struct __pyx_obj_6py_pal_15data_collection_13opcode_metric_OpcodeMetric *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6py_pal_15data_collection_13opcode_metric_12OpcodeMetric_2__str__(struct __pyx_obj_6py_pal_15data_collection_13opcode_metric_OpcodeMetric *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__str__", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("py_pal.data_collection.opcode_metric.OpcodeMetric.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+23: return f"{self.__class__.__name__}()"
__Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_t_1, __pyx_kp_u_); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0;
24:
+25: cdef float pct(self, Py_ssize_t a, Py_ssize_t b):
static float __pyx_f_6py_pal_15data_collection_13opcode_metric_12OpcodeMetric_pct(struct __pyx_obj_6py_pal_15data_collection_13opcode_metric_OpcodeMetric *__pyx_v_self, Py_ssize_t __pyx_v_a, Py_ssize_t __pyx_v_b) { float __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pct", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_WriteUnraisable("py_pal.data_collection.opcode_metric.OpcodeMetric.pct", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+26: if self.builtin_calls > 0:
__pyx_t_1 = ((__pyx_v_self->builtin_calls > 0) != 0); if (__pyx_t_1) { /* … */ }
+27: return round(a / b * 100)
if (unlikely(__pyx_v_b == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 27, __pyx_L1_error) } __pyx_t_2 = PyFloat_FromDouble(((((double)__pyx_v_a) / ((double)__pyx_v_b)) * 100.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_round, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; goto __pyx_L0;
+28: return 0
__pyx_r = 0.0; goto __pyx_L0;
29:
+30: cpdef void report(self):
static PyObject *__pyx_pw_6py_pal_15data_collection_13opcode_metric_12OpcodeMetric_5report(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static void __pyx_f_6py_pal_15data_collection_13opcode_metric_12OpcodeMetric_report(struct __pyx_obj_6py_pal_15data_collection_13opcode_metric_OpcodeMetric *__pyx_v_self, int __pyx_skip_dispatch) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("report", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_report); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6py_pal_15data_collection_13opcode_metric_12OpcodeMetric_5report)) { __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) { __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS } #endif } /* … */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_WriteUnraisable("py_pal.data_collection.opcode_metric.OpcodeMetric.report", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* Python wrapper */ static PyObject *__pyx_pw_6py_pal_15data_collection_13opcode_metric_12OpcodeMetric_5report(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6py_pal_15data_collection_13opcode_metric_12OpcodeMetric_4report[] = "OpcodeMetric.report(self) -> void"; static PyMethodDef __pyx_mdef_6py_pal_15data_collection_13opcode_metric_12OpcodeMetric_5report = {"report", (PyCFunction)__pyx_pw_6py_pal_15data_collection_13opcode_metric_12OpcodeMetric_5report, METH_NOARGS, __pyx_doc_6py_pal_15data_collection_13opcode_metric_12OpcodeMetric_4report}; static PyObject *__pyx_pw_6py_pal_15data_collection_13opcode_metric_12OpcodeMetric_5report(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("report (wrapper)", 0); __pyx_r = __pyx_pf_6py_pal_15data_collection_13opcode_metric_12OpcodeMetric_4report(((struct __pyx_obj_6py_pal_15data_collection_13opcode_metric_OpcodeMetric *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6py_pal_15data_collection_13opcode_metric_12OpcodeMetric_4report(struct __pyx_obj_6py_pal_15data_collection_13opcode_metric_OpcodeMetric *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("report", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_void_to_None(__pyx_f_6py_pal_15data_collection_13opcode_metric_12OpcodeMetric_report(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("py_pal.data_collection.opcode_metric.OpcodeMetric.report", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* … */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6py_pal_15data_collection_13opcode_metric_12OpcodeMetric_5report, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_OpcodeMetric_report, NULL, __pyx_n_s_py_pal_data_collection_opcode_me, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_6py_pal_15data_collection_13opcode_metric_OpcodeMetric->tp_dict, __pyx_n_s_report, __pyx_t_3) < 0) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_6py_pal_15data_collection_13opcode_metric_OpcodeMetric); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_py_pal_data_collection_opcod, __pyx_n_s_report, 30, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 30, __pyx_L1_error)
+31: logger.info(
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+32: f"{self} observed {self.builtin_calls} calls to builtin functions, {self.hits}/{self.builtin_calls} "
__pyx_t_2 = PyTuple_New(11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = 0; __pyx_t_6 = 127; __pyx_t_4 = __Pyx_PyObject_FormatSimple(((PyObject *)__pyx_v_self), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_6; __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_kp_u_observed); __pyx_t_5 += 10; __Pyx_GIVEREF(__pyx_kp_u_observed); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u_observed); __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_self->builtin_calls, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_kp_u_calls_to_builtin_functions); __pyx_t_5 += 29; __Pyx_GIVEREF(__pyx_kp_u_calls_to_builtin_functions); PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_kp_u_calls_to_builtin_functions); __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_self->hits, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_kp_u__2); __pyx_t_5 += 1; __Pyx_GIVEREF(__pyx_kp_u__2); PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_kp_u__2); __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_self->builtin_calls, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_kp_u__3); __pyx_t_5 += 2; __Pyx_GIVEREF(__pyx_kp_u__3); PyTuple_SET_ITEM(__pyx_t_2, 7, __pyx_kp_u__3); /* … */ __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_2, 11, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+33: f"({self.pct(self.hits, self.builtin_calls)}%) have been assigned an opcode weight based on a complexity "
__pyx_t_4 = PyFloat_FromDouble(((struct __pyx_vtabstruct_6py_pal_15data_collection_13opcode_metric_OpcodeMetric *)__pyx_v_self->__pyx_vtab)->pct(__pyx_v_self, __pyx_v_self->hits, __pyx_v_self->builtin_calls)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6; __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 8, __pyx_t_7); __pyx_t_7 = 0; __Pyx_INCREF(__pyx_kp_u_have_been_assigned_an_opcode_we); __pyx_t_5 += 95; __Pyx_GIVEREF(__pyx_kp_u_have_been_assigned_an_opcode_we); PyTuple_SET_ITEM(__pyx_t_2, 9, __pyx_kp_u_have_been_assigned_an_opcode_we);
+34: f"function. Overall sum of opcodes: {self.sum_opcodes}"
__pyx_t_7 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_self->sum_opcodes, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 10, __pyx_t_7); __pyx_t_7 = 0;
35: )
36:
+37: cdef Py_ssize_t get_value(self, FrameType frame) except -1:
static Py_ssize_t __pyx_f_6py_pal_15data_collection_13opcode_metric_12OpcodeMetric_get_value(struct __pyx_obj_6py_pal_15data_collection_13opcode_metric_OpcodeMetric *__pyx_v_self, CYTHON_UNUSED PyFrameObject *__pyx_v_frame) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_value", 0); /* … */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+38: self.sum_opcodes += 1
__pyx_v_self->sum_opcodes = (__pyx_v_self->sum_opcodes + 1);
+39: return 1
__pyx_r = 1; goto __pyx_L0;
40:
+41: cdef bint in_complexity_map(self, object function) except -1:
static int __pyx_f_6py_pal_15data_collection_13opcode_metric_12OpcodeMetric_in_complexity_map(CYTHON_UNUSED struct __pyx_obj_6py_pal_15data_collection_13opcode_metric_OpcodeMetric *__pyx_v_self, PyObject *__pyx_v_function) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("in_complexity_map", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("py_pal.data_collection.opcode_metric.OpcodeMetric.in_complexity_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+42: return PyObject_HasAttr(function, '__qualname__') and function.__qualname__ in AvgBuiltinFuncComplexity.mapping
__pyx_t_2 = (PyObject_HasAttr(__pyx_v_function, __pyx_n_s_qualname) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L3_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_function, __pyx_n_s_qualname); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_AvgBuiltinFuncComplexity); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_mapping); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_3, __pyx_t_5, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = (__pyx_t_2 != 0); __pyx_t_1 = __pyx_t_6; __pyx_L3_bool_binop_done:; __pyx_r = __pyx_t_1; goto __pyx_L0;
43:
+44: cdef Py_ssize_t get_function_opcodes(self, object function, list args, dict kwargs) except -1:
static Py_ssize_t __pyx_f_6py_pal_15data_collection_13opcode_metric_12OpcodeMetric_get_function_opcodes(struct __pyx_obj_6py_pal_15data_collection_13opcode_metric_OpcodeMetric *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { struct __pyx_obj_6py_pal_15data_collection_6metric_CallMetric *__pyx_v_instance = 0; Py_ssize_t __pyx_v_value; Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_function_opcodes", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("py_pal.data_collection.opcode_metric.OpcodeMetric.get_function_opcodes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1L; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_instance); __Pyx_RefNannyFinishContext(); return __pyx_r; }
45: cdef CallMetric instance
46:
+47: if isinstance(function, types.BuiltinFunctionType):
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_types); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_BuiltinFunctionType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = PyObject_IsInstance(__pyx_v_function, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* … */ }
48: # Statistics
+49: self.builtin_calls += 1
__pyx_v_self->builtin_calls = (__pyx_v_self->builtin_calls + 1);
+50: if self.in_complexity_map(function):
__pyx_t_4 = ((struct __pyx_vtabstruct_6py_pal_15data_collection_13opcode_metric_OpcodeMetric *)__pyx_v_self->__pyx_vtab)->in_complexity_map(__pyx_v_self, __pyx_v_function); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 50, __pyx_L1_error)
__pyx_t_3 = (__pyx_t_4 != 0);
if (__pyx_t_3) {
/* … */
}
+51: self.hits += 1
__pyx_v_self->hits = (__pyx_v_self->hits + 1);
52:
+53: if self.in_complexity_map(function):
__pyx_t_3 = ((struct __pyx_vtabstruct_6py_pal_15data_collection_13opcode_metric_OpcodeMetric *)__pyx_v_self->__pyx_vtab)->in_complexity_map(__pyx_v_self, __pyx_v_function); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 53, __pyx_L1_error)
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
/* … */
}
+54: instance = AvgBuiltinFuncComplexity.mapping[function.__qualname__](args, kwargs)
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_AvgBuiltinFuncComplexity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_mapping); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_function, __pyx_n_s_qualname); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_args, __pyx_v_kwargs}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_args, __pyx_v_kwargs}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_v_args); __Pyx_INCREF(__pyx_v_kwargs); __Pyx_GIVEREF(__pyx_v_kwargs); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_kwargs); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6py_pal_15data_collection_6metric_CallMetric))))) __PYX_ERR(0, 54, __pyx_L1_error) __pyx_v_instance = ((struct __pyx_obj_6py_pal_15data_collection_6metric_CallMetric *)__pyx_t_2); __pyx_t_2 = 0;
+55: value = instance.value()
__pyx_t_8 = ((struct __pyx_vtabstruct_6py_pal_15data_collection_6metric_CallMetric *)__pyx_v_instance->__pyx_vtab)->value(__pyx_v_instance); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1L))) __PYX_ERR(0, 55, __pyx_L1_error)
__pyx_v_value = __pyx_t_8;
+56: self.sum_opcodes += value
__pyx_v_self->sum_opcodes = (__pyx_v_self->sum_opcodes + __pyx_v_value);
+57: return value
__pyx_r = __pyx_v_value; goto __pyx_L0;
58:
+59: self.sum_opcodes += 1
__pyx_v_self->sum_opcodes = (__pyx_v_self->sum_opcodes + 1);
+60: return 1
__pyx_r = 1; goto __pyx_L0;
61:
+62: cdef class AdvancedOpcodeMetric(OpcodeMetric):
struct __pyx_vtabstruct_6py_pal_15data_collection_13opcode_metric_AdvancedOpcodeMetric { struct __pyx_vtabstruct_6py_pal_15data_collection_13opcode_metric_OpcodeMetric __pyx_base; }; static struct __pyx_vtabstruct_6py_pal_15data_collection_13opcode_metric_AdvancedOpcodeMetric *__pyx_vtabptr_6py_pal_15data_collection_13opcode_metric_AdvancedOpcodeMetric;
63: """Extended opcode metric that assigns a value dependent on the arguments to builtin calls instead of a constant
64: value.
65: """
+66: cdef Py_ssize_t get_value(self, FrameType frame) except -1:
static Py_ssize_t __pyx_f_6py_pal_15data_collection_13opcode_metric_20AdvancedOpcodeMetric_get_value(struct __pyx_obj_6py_pal_15data_collection_13opcode_metric_AdvancedOpcodeMetric *__pyx_v_self, PyFrameObject *__pyx_v_frame) { PyObject *__pyx_v_code = NULL; PyObject *__pyx_v_op = NULL; PyObject *__pyx_v_argc = NULL; PyObject *__pyx_v_valuestack = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v__callable = NULL; PyObject *__pyx_v_kw_names = NULL; PyObject *__pyx_v_kwargs = NULL; PyObject *__pyx_v_name = NULL; Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_value", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("py_pal.data_collection.opcode_metric.AdvancedOpcodeMetric.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1L; __pyx_L0:; __Pyx_XDECREF(__pyx_v_code); __Pyx_XDECREF(__pyx_v_op); __Pyx_XDECREF(__pyx_v_argc); __Pyx_XDECREF(__pyx_v_valuestack); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v__callable); __Pyx_XDECREF(__pyx_v_kw_names); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_XDECREF(__pyx_v_name); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+67: if frame.f_lasti < 0:
__pyx_t_1 = ((__pyx_v_frame->f_lasti < 0) != 0); if (__pyx_t_1) { /* … */ }
+68: return 1
__pyx_r = 1; goto __pyx_L0;
69:
+70: code = frame.f_code.co_code
__pyx_t_2 = __pyx_v_frame->f_code->co_code;
__Pyx_INCREF(__pyx_t_2);
__pyx_v_code = __pyx_t_2;
__pyx_t_2 = 0;
+71: op = code[frame.f_lasti]
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_code, __pyx_v_frame->f_lasti, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_op = __pyx_t_2; __pyx_t_2 = 0;
72:
+73: if op == 131:
__pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_op, __pyx_int_131, 0x83, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* … */ }
74: # CALL_FUNCTION
+75: argc = unpack_oparg(code[frame.f_lasti:])
__pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_code, __pyx_v_frame->f_lasti, 0, NULL, NULL, NULL, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_6py_pal_15data_collection_9arguments_unpack_oparg(__pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_argc = __pyx_t_3; __pyx_t_3 = 0;
+76: valuestack = <list> get_valuestack(<PyFrameObject *> frame, argc + 1)
__pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_argc, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = get_valuestack(((PyFrameObject *)__pyx_v_frame), __pyx_t_4); __pyx_t_3 = ((PyObject *)__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_v_valuestack = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0;
+77: args = valuestack[1:]
if (unlikely(__pyx_v_valuestack == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 77, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyList_GetSlice(__pyx_v_valuestack, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_args = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0;
+78: _callable = valuestack[0]
if (unlikely(__pyx_v_valuestack == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 78, __pyx_L1_error) } __pyx_t_3 = PyList_GET_ITEM(__pyx_v_valuestack, 0); __Pyx_INCREF(__pyx_t_3); __pyx_v__callable = __pyx_t_3; __pyx_t_3 = 0;
79:
+80: return self.get_function_opcodes(_callable, args, {})
__pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = ((struct __pyx_vtabstruct_6py_pal_15data_collection_13opcode_metric_AdvancedOpcodeMetric *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_function_opcodes(((struct __pyx_obj_6py_pal_15data_collection_13opcode_metric_OpcodeMetric *)__pyx_v_self), __pyx_v__callable, __pyx_v_args, ((PyObject*)__pyx_t_3)); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1L))) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; goto __pyx_L0;
81:
+82: elif op == 141:
__pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_op, __pyx_int_141, 0x8D, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { /* … */ }
83: # CALL_FUNCTION_KW
+84: argc = unpack_oparg(code[frame.f_lasti:])
__pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_code, __pyx_v_frame->f_lasti, 0, NULL, NULL, NULL, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_f_6py_pal_15data_collection_9arguments_unpack_oparg(__pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_argc = __pyx_t_2; __pyx_t_2 = 0;
+85: valuestack = <list> get_valuestack(<PyFrameObject *> frame, argc + 2)
__pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_argc, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = get_valuestack(((PyFrameObject *)__pyx_v_frame), __pyx_t_4); __pyx_t_2 = ((PyObject *)__pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_v_valuestack = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0;
86:
+87: _callable = valuestack.pop(0)
if (unlikely(__pyx_v_valuestack == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop"); __PYX_ERR(0, 87, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyList_PopIndex(__pyx_v_valuestack, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v__callable = __pyx_t_2; __pyx_t_2 = 0;
+88: kw_names = valuestack.pop()
if (unlikely(__pyx_v_valuestack == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop"); __PYX_ERR(0, 88, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyList_Pop(__pyx_v_valuestack); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_kw_names = __pyx_t_2; __pyx_t_2 = 0;
+89: kwargs = {}
__pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_kwargs = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0;
+90: for name in kw_names:
if (likely(PyList_CheckExact(__pyx_v_kw_names)) || PyTuple_CheckExact(__pyx_v_kw_names)) { __pyx_t_2 = __pyx_v_kw_names; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; __pyx_t_6 = NULL; } else { __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_kw_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 90, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 90, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 90, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 90, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; /* … */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+91: kwargs[name] = valuestack.pop()
if (unlikely(__pyx_v_valuestack == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop"); __PYX_ERR(0, 91, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyList_Pop(__pyx_v_valuestack); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_v_name, __pyx_t_3) < 0)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
92:
+93: return self.get_function_opcodes(_callable, valuestack, kwargs)
__pyx_t_4 = ((struct __pyx_vtabstruct_6py_pal_15data_collection_13opcode_metric_AdvancedOpcodeMetric *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_function_opcodes(((struct __pyx_obj_6py_pal_15data_collection_13opcode_metric_OpcodeMetric *)__pyx_v_self), __pyx_v__callable, __pyx_v_valuestack, __pyx_v_kwargs); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1L))) __PYX_ERR(0, 93, __pyx_L1_error)
__pyx_r = __pyx_t_4;
goto __pyx_L0;
94:
+95: self.sum_opcodes += 1
__pyx_v_self->__pyx_base.sum_opcodes = (__pyx_v_self->__pyx_base.sum_opcodes + 1);
+96: return 1
__pyx_r = 1; goto __pyx_L0;