| 1 |
""" |
| 2 |
The table of all LL operations. |
| 3 |
""" |
| 4 |
|
| 5 |
from rpython.rtyper.extregistry import ExtRegistryEntry |
| 6 |
|
| 7 |
|
| 8 |
class LLOp(object): |
| 9 |
|
| 10 |
def __init__(self, sideeffects=True, canfold=False, canraise=(), |
| 11 |
canmallocgc=False, canrun=False, tryfold=False, |
| 12 |
revdb_protect=False): |
| 13 |
|
| 14 |
|
| 15 |
if canfold: |
| 16 |
sideeffects = False |
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
self.sideeffects = sideeffects |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
self.canfold = canfold |
| 25 |
|
| 26 |
|
| 27 |
self.tryfold = tryfold or canfold |
| 28 |
|
| 29 |
|
| 30 |
self.canraise = canraise |
| 31 |
assert isinstance(canraise, tuple) |
| 32 |
|
| 33 |
assert not canraise or not canfold |
| 34 |
|
| 35 |
|
| 36 |
self.canmallocgc = canmallocgc |
| 37 |
if canmallocgc: |
| 38 |
if (MemoryError not in self.canraise and |
| 39 |
Exception not in self.canraise): |
| 40 |
self.canraise += (MemoryError,) |
| 41 |
|
| 42 |
|
| 43 |
self.canrun = canrun or canfold |
| 44 |
|
| 45 |
|
| 46 |
self.revdb_protect = revdb_protect |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
__name__ = property(lambda self: 'llop_'+self.opname) |
| 51 |
|
| 52 |
def __call__(self, RESULTTYPE, *args): |
| 53 |
|
| 54 |
|
| 55 |
fold = self.fold |
| 56 |
if getattr(fold, 'need_result_type', False): |
| 57 |
val = fold(RESULTTYPE, *args) |
| 58 |
else: |
| 59 |
val = fold(*args) |
| 60 |
if RESULTTYPE is not lltype.Void: |
| 61 |
val = lltype.enforce(RESULTTYPE, val) |
| 62 |
return val |
| 63 |
|
| 64 |
@property |
| 65 |
def fold(self): |
| 66 |
if hasattr(self, "_fold"): |
| 67 |
return self._fold |
| 68 |
global lltype |
| 69 |
from rpython.rtyper.lltypesystem import lltype |
| 70 |
if self.canrun: |
| 71 |
from rpython.rtyper.lltypesystem.opimpl import get_op_impl |
| 72 |
op_impl = get_op_impl(self.opname) |
| 73 |
else: |
| 74 |
error = TypeError("cannot constant-fold operation %r" % ( |
| 75 |
self.opname,)) |
| 76 |
def op_impl(*args): |
| 77 |
raise error |
| 78 |
|
| 79 |
self._fold = op_impl |
| 80 |
return op_impl |
| 81 |
|
| 82 |
def is_pure(self, args_v): |
| 83 |
if self.canfold: |
| 84 |
return True |
| 85 |
if (self is llop.debug_assert or |
| 86 |
self is llop.debug_assert_not_none): |
| 87 |
return True |
| 88 |
|
| 89 |
if self is llop.getfield or self is llop.getarrayitem: |
| 90 |
field = getattr(args_v[1], 'value', None) |
| 91 |
return args_v[0].concretetype.TO._immutable_field(field) |
| 92 |
|
| 93 |
return False |
| 94 |
|
| 95 |
def __repr__(self): |
| 96 |
return '<LLOp %s>' % (getattr(self, 'opname', '?'),) |
| 97 |
|
| 98 |
|
| 99 |
class _LLOP(object): |
| 100 |
def _freeze_(self): |
| 101 |
return True |
| 102 |
llop = _LLOP() |
| 103 |
|
| 104 |
class VoidMarker(object): |
| 105 |
|
| 106 |
def __init__(self, value): |
| 107 |
self.value = value |
| 108 |
def _freeze_(self): |
| 109 |
return True |
| 110 |
|
| 111 |
def void(value): |
| 112 |
return VoidMarker(value) |
| 113 |
|
| 114 |
class Entry(ExtRegistryEntry): |
| 115 |
_about_ = void |
| 116 |
|
| 117 |
def compute_result_annotation(self, s_value): |
| 118 |
assert s_value.is_constant() |
| 119 |
from rpython.annotator.bookkeeper import getbookkeeper |
| 120 |
bk = getbookkeeper() |
| 121 |
return bk.immutablevalue(VoidMarker(s_value.const)) |
| 122 |
|
| 123 |
def specialize_call(self, hop): |
| 124 |
from rpython.rtyper.lltypesystem import lltype |
| 125 |
hop.exception_cannot_occur() |
| 126 |
return hop.inputconst(lltype.Void, None) |
| 127 |
|
| 128 |
def enum_ops_without_sideeffects(raising_is_ok=False): |
| 129 |
"""Enumerate operations that have no side-effects |
| 130 |
(see also enum_foldable_ops).""" |
| 131 |
for opname, opdesc in LL_OPERATIONS.iteritems(): |
| 132 |
if not opdesc.sideeffects: |
| 133 |
if not opdesc.canraise or raising_is_ok: |
| 134 |
yield opname |
| 135 |
|
| 136 |
def enum_foldable_ops(_ignored=None): |
| 137 |
"""Enumerate operations that can be constant-folded.""" |
| 138 |
for opname, opdesc in LL_OPERATIONS.iteritems(): |
| 139 |
if opdesc.canfold: |
| 140 |
assert not opdesc.canraise |
| 141 |
yield opname |
| 142 |
|
| 143 |
|
| 144 |
class Entry(ExtRegistryEntry): |
| 145 |
"Annotation and rtyping of LLOp instances, which are callable." |
| 146 |
_type_ = LLOp |
| 147 |
|
| 148 |
def compute_result_annotation(self, RESULTTYPE, *args): |
| 149 |
from rpython.rtyper.llannotation import lltype_to_annotation |
| 150 |
assert RESULTTYPE.is_constant() |
| 151 |
return lltype_to_annotation(RESULTTYPE.const) |
| 152 |
|
| 153 |
def specialize_call(self, hop): |
| 154 |
from rpython.rtyper.lltypesystem import lltype |
| 155 |
op = self.instance |
| 156 |
args_v = [] |
| 157 |
for i, s_arg in enumerate(hop.args_s[1:]): |
| 158 |
if s_arg.is_constant() and isinstance(s_arg.const, VoidMarker): |
| 159 |
v_arg = hop.inputconst(lltype.Void, s_arg.const.value) |
| 160 |
else: |
| 161 |
v_arg = hop.inputarg(hop.args_r[i+1], i+1) |
| 162 |
args_v.append(v_arg) |
| 163 |
|
| 164 |
if op.canraise: |
| 165 |
hop.exception_is_here() |
| 166 |
else: |
| 167 |
hop.exception_cannot_occur() |
| 168 |
return hop.genop(op.opname, args_v, resulttype=hop.r_result.lowleveltype) |
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
|
| 173 |
|
| 174 |
|
| 175 |
|
| 176 |
LL_OPERATIONS = { |
| 177 |
|
| 178 |
'direct_call': LLOp(canraise=(Exception,)), |
| 179 |
'indirect_call': LLOp(canraise=(Exception,)), |
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
'bool_not': LLOp(canfold=True), |
| 184 |
|
| 185 |
'char_lt': LLOp(canfold=True), |
| 186 |
'char_le': LLOp(canfold=True), |
| 187 |
'char_eq': LLOp(canfold=True), |
| 188 |
'char_ne': LLOp(canfold=True), |
| 189 |
'char_gt': LLOp(canfold=True), |
| 190 |
'char_ge': LLOp(canfold=True), |
| 191 |
|
| 192 |
'unichar_eq': LLOp(canfold=True), |
| 193 |
'unichar_ne': LLOp(canfold=True), |
| 194 |
|
| 195 |
'int_is_true': LLOp(canfold=True), |
| 196 |
'int_neg': LLOp(canfold=True), |
| 197 |
'int_abs': LLOp(canfold=True), |
| 198 |
'int_invert': LLOp(canfold=True), |
| 199 |
|
| 200 |
'int_add': LLOp(canfold=True), |
| 201 |
'int_sub': LLOp(canfold=True), |
| 202 |
'int_mul': LLOp(canfold=True), |
| 203 |
'int_floordiv': LLOp(canfold=True), |
| 204 |
'int_mod': LLOp(canfold=True), |
| 205 |
'int_lt': LLOp(canfold=True), |
| 206 |
'int_le': LLOp(canfold=True), |
| 207 |
'int_eq': LLOp(canfold=True), |
| 208 |
'int_ne': LLOp(canfold=True), |
| 209 |
'int_gt': LLOp(canfold=True), |
| 210 |
'int_ge': LLOp(canfold=True), |
| 211 |
'int_and': LLOp(canfold=True), |
| 212 |
'int_or': LLOp(canfold=True), |
| 213 |
'int_lshift': LLOp(canfold=True), |
| 214 |
'int_rshift': LLOp(canfold=True), |
| 215 |
'int_xor': LLOp(canfold=True), |
| 216 |
|
| 217 |
'int_between': LLOp(canfold=True), |
| 218 |
'int_force_ge_zero': LLOp(canfold=True), |
| 219 |
|
| 220 |
'int_add_ovf': LLOp(canraise=(OverflowError,), tryfold=True), |
| 221 |
'int_add_nonneg_ovf': LLOp(canraise=(OverflowError,), tryfold=True), |
| 222 |
|
| 223 |
'int_sub_ovf': LLOp(canraise=(OverflowError,), tryfold=True), |
| 224 |
'int_mul_ovf': LLOp(canraise=(OverflowError,), tryfold=True), |
| 225 |
|
| 226 |
'uint_is_true': LLOp(canfold=True), |
| 227 |
'uint_invert': LLOp(canfold=True), |
| 228 |
|
| 229 |
'uint_add': LLOp(canfold=True), |
| 230 |
'uint_sub': LLOp(canfold=True), |
| 231 |
'uint_mul': LLOp(canfold=True), |
| 232 |
'uint_floordiv': LLOp(canfold=True), |
| 233 |
'uint_mod': LLOp(canfold=True), |
| 234 |
'uint_lt': LLOp(canfold=True), |
| 235 |
'uint_le': LLOp(canfold=True), |
| 236 |
'uint_eq': LLOp(canfold=True), |
| 237 |
'uint_ne': LLOp(canfold=True), |
| 238 |
'uint_gt': LLOp(canfold=True), |
| 239 |
'uint_ge': LLOp(canfold=True), |
| 240 |
'uint_and': LLOp(canfold=True), |
| 241 |
'uint_or': LLOp(canfold=True), |
| 242 |
'uint_lshift': LLOp(canfold=True), |
| 243 |
'uint_rshift': LLOp(canfold=True), |
| 244 |
'uint_xor': LLOp(canfold=True), |
| 245 |
|
| 246 |
'float_is_true': LLOp(canfold=True), |
| 247 |
'float_neg': LLOp(canfold=True), |
| 248 |
'float_abs': LLOp(canfold=True), |
| 249 |
|
| 250 |
'float_add': LLOp(canfold=True), |
| 251 |
'float_sub': LLOp(canfold=True), |
| 252 |
'float_mul': LLOp(canfold=True), |
| 253 |
'float_truediv': LLOp(canfold=True), |
| 254 |
'float_lt': LLOp(canfold=True), |
| 255 |
'float_le': LLOp(canfold=True), |
| 256 |
'float_eq': LLOp(canfold=True), |
| 257 |
'float_ne': LLOp(canfold=True), |
| 258 |
'float_gt': LLOp(canfold=True), |
| 259 |
'float_ge': LLOp(canfold=True), |
| 260 |
|
| 261 |
|
| 262 |
|
| 263 |
'llong_is_true': LLOp(canfold=True), |
| 264 |
'llong_neg': LLOp(canfold=True), |
| 265 |
'llong_abs': LLOp(canfold=True), |
| 266 |
'llong_invert': LLOp(canfold=True), |
| 267 |
|
| 268 |
'llong_add': LLOp(canfold=True), |
| 269 |
'llong_sub': LLOp(canfold=True), |
| 270 |
'llong_mul': LLOp(canfold=True), |
| 271 |
'llong_floordiv': LLOp(canfold=True), |
| 272 |
'llong_mod': LLOp(canfold=True), |
| 273 |
'llong_lt': LLOp(canfold=True), |
| 274 |
'llong_le': LLOp(canfold=True), |
| 275 |
'llong_eq': LLOp(canfold=True), |
| 276 |
'llong_ne': LLOp(canfold=True), |
| 277 |
'llong_gt': LLOp(canfold=True), |
| 278 |
'llong_ge': LLOp(canfold=True), |
| 279 |
'llong_and': LLOp(canfold=True), |
| 280 |
'llong_or': LLOp(canfold=True), |
| 281 |
'llong_lshift': LLOp(canfold=True), |
| 282 |
'llong_rshift': LLOp(canfold=True), |
| 283 |
'llong_xor': LLOp(canfold=True), |
| 284 |
|
| 285 |
'ullong_is_true': LLOp(canfold=True), |
| 286 |
'ullong_invert': LLOp(canfold=True), |
| 287 |
|
| 288 |
'ullong_add': LLOp(canfold=True), |
| 289 |
'ullong_sub': LLOp(canfold=True), |
| 290 |
'ullong_mul': LLOp(canfold=True), |
| 291 |
'ullong_floordiv': LLOp(canfold=True), |
| 292 |
'ullong_mod': LLOp(canfold=True), |
| 293 |
'ullong_lt': LLOp(canfold=True), |
| 294 |
'ullong_le': LLOp(canfold=True), |
| 295 |
'ullong_eq': LLOp(canfold=True), |
| 296 |
'ullong_ne': LLOp(canfold=True), |
| 297 |
'ullong_gt': LLOp(canfold=True), |
| 298 |
'ullong_ge': LLOp(canfold=True), |
| 299 |
'ullong_and': LLOp(canfold=True), |
| 300 |
'ullong_or': LLOp(canfold=True), |
| 301 |
'ullong_lshift': LLOp(canfold=True), |
| 302 |
'ullong_rshift': LLOp(canfold=True), |
| 303 |
'ullong_xor': LLOp(canfold=True), |
| 304 |
|
| 305 |
'lllong_is_true': LLOp(canfold=True), |
| 306 |
'lllong_neg': LLOp(canfold=True), |
| 307 |
'lllong_abs': LLOp(canfold=True), |
| 308 |
'lllong_invert': LLOp(canfold=True), |
| 309 |
|
| 310 |
'lllong_add': LLOp(canfold=True), |
| 311 |
'lllong_sub': LLOp(canfold=True), |
| 312 |
'lllong_mul': LLOp(canfold=True), |
| 313 |
'lllong_floordiv': LLOp(canfold=True), |
| 314 |
'lllong_mod': LLOp(canfold=True), |
| 315 |
'lllong_lt': LLOp(canfold=True), |
| 316 |
'lllong_le': LLOp(canfold=True), |
| 317 |
'lllong_eq': LLOp(canfold=True), |
| 318 |
'lllong_ne': LLOp(canfold=True), |
| 319 |
'lllong_gt': LLOp(canfold=True), |
| 320 |
'lllong_ge': LLOp(canfold=True), |
| 321 |
'lllong_and': LLOp(canfold=True), |
| 322 |
'lllong_or': LLOp(canfold=True), |
| 323 |
'lllong_lshift': LLOp(canfold=True), |
| 324 |
'lllong_rshift': LLOp(canfold=True), |
| 325 |
'lllong_xor': LLOp(canfold=True), |
| 326 |
|
| 327 |
'ulllong_is_true': LLOp(canfold=True), |
| 328 |
'ulllong_invert': LLOp(canfold=True), |
| 329 |
|
| 330 |
'ulllong_add': LLOp(canfold=True), |
| 331 |
'ulllong_sub': LLOp(canfold=True), |
| 332 |
'ulllong_mul': LLOp(canfold=True), |
| 333 |
'ulllong_floordiv': LLOp(canfold=True), |
| 334 |
'ulllong_mod': LLOp(canfold=True), |
| 335 |
'ulllong_lt': LLOp(canfold=True), |
| 336 |
'ulllong_le': LLOp(canfold=True), |
| 337 |
'ulllong_eq': LLOp(canfold=True), |
| 338 |
'ulllong_ne': LLOp(canfold=True), |
| 339 |
'ulllong_gt': LLOp(canfold=True), |
| 340 |
'ulllong_ge': LLOp(canfold=True), |
| 341 |
'ulllong_and': LLOp(canfold=True), |
| 342 |
'ulllong_or': LLOp(canfold=True), |
| 343 |
'ulllong_lshift': LLOp(canfold=True), |
| 344 |
'ulllong_rshift': LLOp(canfold=True), |
| 345 |
'ulllong_xor': LLOp(canfold=True), |
| 346 |
|
| 347 |
'cast_primitive': LLOp(canfold=True), |
| 348 |
'cast_bool_to_int': LLOp(canfold=True), |
| 349 |
'cast_bool_to_uint': LLOp(canfold=True), |
| 350 |
'cast_bool_to_float': LLOp(canfold=True), |
| 351 |
'cast_char_to_int': LLOp(canfold=True), |
| 352 |
'cast_unichar_to_int': LLOp(canfold=True), |
| 353 |
'cast_int_to_char': LLOp(canfold=True), |
| 354 |
'cast_int_to_unichar': LLOp(canfold=True), |
| 355 |
'cast_int_to_uint': LLOp(canfold=True), |
| 356 |
'cast_int_to_float': LLOp(canfold=True), |
| 357 |
'cast_int_to_longlong': LLOp(canfold=True), |
| 358 |
'cast_uint_to_int': LLOp(canfold=True), |
| 359 |
'cast_uint_to_float': LLOp(canfold=True), |
| 360 |
'cast_longlong_to_float' :LLOp(canfold=True), |
| 361 |
'cast_ulonglong_to_float':LLOp(canfold=True), |
| 362 |
'cast_float_to_int': LLOp(canfold=True), |
| 363 |
'cast_float_to_uint': LLOp(canfold=True), |
| 364 |
'cast_float_to_longlong' :LLOp(canfold=True), |
| 365 |
'cast_float_to_ulonglong':LLOp(canfold=True), |
| 366 |
'truncate_longlong_to_int':LLOp(canfold=True), |
| 367 |
'force_cast': LLOp(sideeffects=False), |
| 368 |
'convert_float_bytes_to_longlong': LLOp(canfold=True), |
| 369 |
'convert_longlong_bytes_to_float': LLOp(canfold=True), |
| 370 |
|
| 371 |
'likely': LLOp(canfold=True), |
| 372 |
'unlikely': LLOp(canfold=True), |
| 373 |
|
| 374 |
|
| 375 |
|
| 376 |
'malloc': LLOp(canmallocgc=True), |
| 377 |
'malloc_varsize': LLOp(canmallocgc=True), |
| 378 |
'shrink_array': LLOp(canrun=True), |
| 379 |
'zero_gc_pointers_inside': LLOp(), |
| 380 |
'free': LLOp(), |
| 381 |
'getfield': LLOp(sideeffects=False, canrun=True), |
| 382 |
'getarrayitem': LLOp(sideeffects=False, canrun=True), |
| 383 |
'getarraysize': LLOp(canfold=True), |
| 384 |
'getsubstruct': LLOp(canfold=True), |
| 385 |
'getinteriorfield': LLOp(sideeffects=False, canrun=True), |
| 386 |
'getinteriorarraysize': LLOp(canfold=True), |
| 387 |
'setinteriorfield': LLOp(), |
| 388 |
'bare_setinteriorfield': LLOp(), |
| 389 |
'getarraysubstruct': LLOp(canfold=True), |
| 390 |
'setfield': LLOp(), |
| 391 |
'bare_setfield': LLOp(), |
| 392 |
'setarrayitem': LLOp(), |
| 393 |
'bare_setarrayitem': LLOp(), |
| 394 |
'cast_pointer': LLOp(canfold=True), |
| 395 |
'ptr_eq': LLOp(canfold=True), |
| 396 |
'ptr_ne': LLOp(canfold=True), |
| 397 |
'ptr_nonzero': LLOp(canfold=True), |
| 398 |
'ptr_iszero': LLOp(canfold=True), |
| 399 |
'cast_ptr_to_int': LLOp(sideeffects=False), |
| 400 |
'cast_int_to_ptr': LLOp(sideeffects=False), |
| 401 |
'direct_fieldptr': LLOp(canfold=True), |
| 402 |
'direct_arrayitems': LLOp(canfold=True), |
| 403 |
'direct_ptradd': LLOp(canfold=True), |
| 404 |
'cast_opaque_ptr': LLOp(sideeffects=False), |
| 405 |
'length_of_simple_gcarray_from_opaque': LLOp(sideeffects=False), |
| 406 |
|
| 407 |
|
| 408 |
|
| 409 |
'boehm_malloc': LLOp(), |
| 410 |
'boehm_malloc_atomic': LLOp(), |
| 411 |
'boehm_register_finalizer': LLOp(), |
| 412 |
'boehm_disappearing_link': LLOp(), |
| 413 |
'raw_malloc': LLOp(revdb_protect=True), |
| 414 |
'raw_malloc_usage': LLOp(sideeffects=False), |
| 415 |
'raw_free': LLOp(revdb_protect=True), |
| 416 |
'raw_memclear': LLOp(revdb_protect=True), |
| 417 |
'raw_memset': LLOp(revdb_protect=True), |
| 418 |
'raw_memcopy': LLOp(revdb_protect=True), |
| 419 |
'raw_memmove': LLOp(revdb_protect=True), |
| 420 |
'raw_load': LLOp(revdb_protect=True, sideeffects=False, |
| 421 |
canrun=True), |
| 422 |
'raw_store': LLOp(revdb_protect=True, canrun=True), |
| 423 |
'bare_raw_store': LLOp(revdb_protect=True), |
| 424 |
'gc_load_indexed': LLOp(sideeffects=False, canrun=True), |
| 425 |
'gc_store': LLOp(canrun=True), |
| 426 |
'gc_store_indexed': LLOp(canrun=True), |
| 427 |
'track_alloc_start': LLOp(), |
| 428 |
'track_alloc_stop': LLOp(), |
| 429 |
'adr_add': LLOp(canfold=True), |
| 430 |
'adr_sub': LLOp(canfold=True), |
| 431 |
'adr_delta': LLOp(canfold=True), |
| 432 |
'adr_lt': LLOp(canfold=True), |
| 433 |
'adr_le': LLOp(canfold=True), |
| 434 |
'adr_eq': LLOp(canfold=True), |
| 435 |
'adr_ne': LLOp(canfold=True), |
| 436 |
'adr_gt': LLOp(canfold=True), |
| 437 |
'adr_ge': LLOp(canfold=True), |
| 438 |
'cast_ptr_to_adr': LLOp(sideeffects=False), |
| 439 |
'cast_adr_to_ptr': LLOp(canfold=True), |
| 440 |
'cast_adr_to_int': LLOp(sideeffects=False), |
| 441 |
'cast_int_to_adr': LLOp(canfold=True), |
| 442 |
|
| 443 |
'get_group_member': LLOp(canfold=True), |
| 444 |
'get_next_group_member':LLOp(canfold=True), |
| 445 |
'is_group_member_nonzero':LLOp(canfold=True), |
| 446 |
'extract_ushort': LLOp(canfold=True), |
| 447 |
'combine_ushort': LLOp(canfold=True), |
| 448 |
'gc_gettypeptr_group': LLOp(canfold=True), |
| 449 |
'get_member_index': LLOp(canfold=True), |
| 450 |
|
| 451 |
|
| 452 |
|
| 453 |
'jit_marker': LLOp(), |
| 454 |
'jit_force_virtualizable':LLOp(canrun=True), |
| 455 |
'jit_force_virtual': LLOp(canrun=True), |
| 456 |
'jit_is_virtual': LLOp(canrun=True), |
| 457 |
'jit_force_quasi_immutable': LLOp(canrun=True), |
| 458 |
'jit_record_exact_class' : LLOp(canrun=True), |
| 459 |
'jit_record_exact_value' : LLOp(canrun=True), |
| 460 |
'jit_ffi_save_result': LLOp(canrun=True), |
| 461 |
'jit_conditional_call': LLOp(), |
| 462 |
'jit_conditional_call_value': LLOp(), |
| 463 |
'jit_enter_portal_frame': LLOp(canrun=True), |
| 464 |
'jit_leave_portal_frame': LLOp(canrun=True), |
| 465 |
'get_exception_addr': LLOp(), |
| 466 |
'get_exc_value_addr': LLOp(), |
| 467 |
'do_malloc_fixedsize':LLOp(canmallocgc=True), |
| 468 |
'do_malloc_fixedsize_clear': LLOp(canmallocgc=True), |
| 469 |
'do_malloc_varsize': LLOp(canmallocgc=True), |
| 470 |
'do_malloc_varsize_clear': LLOp(canmallocgc=True), |
| 471 |
'get_write_barrier_failing_case': LLOp(sideeffects=False), |
| 472 |
'get_write_barrier_from_array_failing_case': LLOp(sideeffects=False), |
| 473 |
'gc_get_type_info_group': LLOp(sideeffects=False), |
| 474 |
'll_read_timestamp': LLOp(revdb_protect=True, canrun=True), |
| 475 |
'll_get_timestamp_unit': LLOp(revdb_protect=True, canrun=True), |
| 476 |
'jit_record_known_result': LLOp(canrun=True), |
| 477 |
|
| 478 |
|
| 479 |
|
| 480 |
'gc__collect': LLOp(canmallocgc=True), |
| 481 |
'gc__collect_step': LLOp(canmallocgc=True), |
| 482 |
'gc__enable': LLOp(), |
| 483 |
'gc__disable': LLOp(), |
| 484 |
'gc__isenabled': LLOp(), |
| 485 |
'gc_free': LLOp(), |
| 486 |
'gc_fetch_exception': LLOp(), |
| 487 |
'gc_restore_exception': LLOp(), |
| 488 |
'gc_call_rtti_destructor': LLOp(), |
| 489 |
'gc_deallocate': LLOp(), |
| 490 |
'gc_reload_possibly_moved': LLOp(), |
| 491 |
|
| 492 |
'gc_identityhash': LLOp(sideeffects=False, canmallocgc=True), |
| 493 |
'gc_id': LLOp(sideeffects=False, canmallocgc=True), |
| 494 |
'gc_obtain_free_space': LLOp(revdb_protect=True), |
| 495 |
'gc_set_max_heap_size': LLOp(revdb_protect=True), |
| 496 |
'gc_can_move' : LLOp(sideeffects=False), |
| 497 |
'gc_thread_run' : LLOp(), |
| 498 |
'gc_thread_start' : LLOp(), |
| 499 |
'gc_thread_die' : LLOp(), |
| 500 |
'gc_thread_before_fork':LLOp(), |
| 501 |
'gc_thread_after_fork': LLOp(), |
| 502 |
'gc_writebarrier': LLOp(canrun=True), |
| 503 |
'gc_writebarrier_before_copy': LLOp(canrun=True), |
| 504 |
'gc_writebarrier_before_move': LLOp(canrun=True), |
| 505 |
'gc_heap_stats' : LLOp(canmallocgc=True), |
| 506 |
'gc_pin' : LLOp(canrun=True), |
| 507 |
'gc_unpin' : LLOp(canrun=True), |
| 508 |
'gc__is_pinned' : LLOp(canrun=True), |
| 509 |
'gc_bit' : LLOp(sideeffects=False, canrun=True), |
| 510 |
|
| 511 |
'gc_get_rpy_roots' : LLOp(), |
| 512 |
'gc_get_rpy_referents': LLOp(), |
| 513 |
'gc_get_rpy_memory_usage': LLOp(), |
| 514 |
'gc_get_rpy_type_index': LLOp(), |
| 515 |
'gc_is_rpy_instance' : LLOp(), |
| 516 |
'gc_dump_rpy_heap' : LLOp(canraise=(OSError,)), |
| 517 |
'gc_typeids_z' : LLOp(), |
| 518 |
'gc_typeids_list' : LLOp(), |
| 519 |
'gc_gettypeid' : LLOp(), |
| 520 |
'gc_gcflag_extra' : LLOp(), |
| 521 |
'gc_add_memory_pressure': LLOp(), |
| 522 |
'gc_get_stats' : LLOp(), |
| 523 |
'gc_fq_next_dead' : LLOp(), |
| 524 |
'gc_fq_register' : LLOp(), |
| 525 |
'gc_ignore_finalizer' : LLOp(canrun=True), |
| 526 |
|
| 527 |
'gc_rawrefcount_init': LLOp(), |
| 528 |
'gc_rawrefcount_create_link_pypy': LLOp(), |
| 529 |
'gc_rawrefcount_create_link_pyobj': LLOp(), |
| 530 |
'gc_rawrefcount_mark_deallocating': LLOp(), |
| 531 |
'gc_rawrefcount_from_obj': LLOp(sideeffects=False), |
| 532 |
'gc_rawrefcount_to_obj': LLOp(sideeffects=False), |
| 533 |
'gc_rawrefcount_next_dead': LLOp(), |
| 534 |
|
| 535 |
'gc_move_out_of_nursery': LLOp(), |
| 536 |
'gc_increase_root_stack_depth': LLOp(canrun=True), |
| 537 |
|
| 538 |
'gc_push_roots' : LLOp(), |
| 539 |
'gc_pop_roots' : LLOp(), |
| 540 |
'gc_enter_roots_frame' : LLOp(), |
| 541 |
'gc_leave_roots_frame' : LLOp(), |
| 542 |
'gc_save_root' : LLOp(), |
| 543 |
'gc_restore_root' : LLOp(), |
| 544 |
|
| 545 |
|
| 546 |
|
| 547 |
'gc_adr_of_nursery_free' : LLOp(), |
| 548 |
|
| 549 |
'gc_adr_of_nursery_top' : LLOp(), |
| 550 |
|
| 551 |
'gc_adr_of_root_stack_base': LLOp(), |
| 552 |
'gc_adr_of_root_stack_top': LLOp(), |
| 553 |
|
| 554 |
'gc_modified_shadowstack': LLOp(), |
| 555 |
|
| 556 |
'gc_stack_bottom': LLOp(canrun=True), |
| 557 |
|
| 558 |
|
| 559 |
|
| 560 |
|
| 561 |
|
| 562 |
|
| 563 |
'weakref_create': LLOp(sideeffects=False, canmallocgc=True), |
| 564 |
'weakref_deref': LLOp(sideeffects=False), |
| 565 |
'cast_ptr_to_weakrefptr': LLOp(sideeffects=False), |
| 566 |
'cast_weakrefptr_to_ptr': LLOp(sideeffects=False), |
| 567 |
|
| 568 |
|
| 569 |
|
| 570 |
'stack_current': LLOp(revdb_protect=True, sideeffects=False), |
| 571 |
'keepalive': LLOp(), |
| 572 |
'same_as': LLOp(canfold=True), |
| 573 |
'hint': LLOp(), |
| 574 |
'check_no_more_arg': LLOp(canraise=(Exception,)), |
| 575 |
'check_self_nonzero': LLOp(canraise=(Exception,)), |
| 576 |
'decode_arg': LLOp(canraise=(Exception,)), |
| 577 |
'decode_arg_def': LLOp(canraise=(Exception,)), |
| 578 |
'getslice': LLOp(canraise=(Exception,)), |
| 579 |
'check_and_clear_exc': LLOp(), |
| 580 |
|
| 581 |
'threadlocalref_addr': LLOp(), |
| 582 |
'threadlocalref_get': LLOp(sideeffects=False), |
| 583 |
'threadlocalref_load': LLOp(), |
| 584 |
'threadlocalref_store': LLOp(), |
| 585 |
'threadlocalref_acquire': LLOp(), |
| 586 |
'threadlocalref_release': LLOp(), |
| 587 |
'threadlocalref_enum': LLOp(sideeffects=False), |
| 588 |
|
| 589 |
|
| 590 |
'debug_view': LLOp(), |
| 591 |
'debug_print': LLOp(canrun=True), |
| 592 |
'debug_start': LLOp(canrun=True), |
| 593 |
'debug_stop': LLOp(canrun=True), |
| 594 |
'have_debug_prints': LLOp(canrun=True), |
| 595 |
'have_debug_prints_for': LLOp(canrun=True), |
| 596 |
'debug_offset': LLOp(canrun=True), |
| 597 |
'debug_flush': LLOp(canrun=True), |
| 598 |
'debug_assert': LLOp(tryfold=True), |
| 599 |
'debug_assert_not_none': LLOp(tryfold=True), |
| 600 |
'debug_fatalerror': LLOp(canrun=True), |
| 601 |
'debug_llinterpcall': LLOp(canraise=(Exception,)), |
| 602 |
|
| 603 |
|
| 604 |
'debug_start_traceback': LLOp(), |
| 605 |
'debug_record_traceback': LLOp(), |
| 606 |
'debug_catch_exception': LLOp(), |
| 607 |
'debug_reraise_traceback': LLOp(), |
| 608 |
'debug_print_traceback': LLOp(), |
| 609 |
'debug_nonnull_pointer': LLOp(canrun=True), |
| 610 |
'debug_forked': LLOp(), |
| 611 |
|
| 612 |
|
| 613 |
'instrument_count': LLOp(), |
| 614 |
|
| 615 |
'revdb_stop_point': LLOp(), |
| 616 |
'revdb_send_answer': LLOp(), |
| 617 |
'revdb_breakpoint': LLOp(), |
| 618 |
'revdb_get_value': LLOp(sideeffects=False), |
| 619 |
'revdb_get_unique_id': LLOp(sideeffects=False), |
| 620 |
'revdb_watch_save_state': LLOp(), |
| 621 |
'revdb_watch_restore_state': LLOp(), |
| 622 |
'revdb_weakref_create': LLOp(), |
| 623 |
'revdb_weakref_deref': LLOp(), |
| 624 |
'revdb_call_destructor': LLOp(), |
| 625 |
'revdb_set_thread_breakpoint': LLOp(), |
| 626 |
'revdb_strtod': LLOp(sideeffects=False), |
| 627 |
'revdb_dtoa': LLOp(sideeffects=False), |
| 628 |
'revdb_modf': LLOp(sideeffects=False), |
| 629 |
'revdb_frexp': LLOp(sideeffects=False), |
| 630 |
'revdb_do_next_call': LLOp(canrun=True), |
| 631 |
} |
| 632 |
|
| 633 |
|
| 634 |
|
| 635 |
|
| 636 |
|
| 637 |
|
| 638 |
for opname, opdesc in LL_OPERATIONS.iteritems(): |
| 639 |
opdesc.opname = opname |
| 640 |
del opname, opdesc |
| 641 |
|
| 642 |
|
| 643 |
|
| 644 |
|
| 645 |
for opname, opdesc in LL_OPERATIONS.iteritems(): |
| 646 |
setattr(llop, opname, opdesc) |
| 647 |
del opname, opdesc |