PageRenderTime 42ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/rpython/jit/metainterp/executor.py

https://bitbucket.org/pypy/pypy/
Python | 580 lines | 504 code | 0 blank | 76 comment | 1 complexity | 44ab68faf1aeb48aa77ed30c9a8a31da MD5 | raw file
Possible License(s): AGPL-3.0, BSD-3-Clause, Apache-2.0
  1. """This implements pyjitpl's execution of operations.
  2. """
  3. from rpython.rtyper.lltypesystem import lltype, rstr, llmemory
  4. from rpython.rlib.rarithmetic import ovfcheck, r_longlong, is_valid_int
  5. from rpython.rlib.unroll import unrolling_iterable
  6. from rpython.rlib.objectmodel import specialize
  7. from rpython.jit.metainterp.history import check_descr
  8. from rpython.jit.metainterp.history import INT, REF, FLOAT, VOID, AbstractDescr
  9. from rpython.jit.metainterp.history import ConstInt, ConstFloat, ConstPtr
  10. from rpython.jit.metainterp import resoperation
  11. from rpython.jit.metainterp.resoperation import rop, opname
  12. from rpython.jit.metainterp.blackhole import BlackholeInterpreter, NULL
  13. from rpython.jit.codewriter import longlong
  14. # ____________________________________________________________
  15. @specialize.arg(4)
  16. def _do_call(cpu, metainterp, argboxes, descr, rettype):
  17. assert metainterp is not None
  18. # count the number of arguments of the different types
  19. count_i = count_r = count_f = 0
  20. for i in range(1, len(argboxes)):
  21. type = argboxes[i].type
  22. if type == INT: count_i += 1
  23. elif type == REF: count_r += 1
  24. elif type == FLOAT: count_f += 1
  25. # allocate lists for each type that has at least one argument
  26. if count_i: args_i = [0] * count_i
  27. else: args_i = None
  28. if count_r: args_r = [NULL] * count_r
  29. else: args_r = None
  30. if count_f: args_f = [longlong.ZEROF] * count_f
  31. else: args_f = None
  32. # fill in the lists
  33. count_i = count_r = count_f = 0
  34. for i in range(1, len(argboxes)):
  35. box = argboxes[i]
  36. if box.type == INT:
  37. args_i[count_i] = box.getint()
  38. count_i += 1
  39. elif box.type == REF:
  40. args_r[count_r] = box.getref_base()
  41. count_r += 1
  42. elif box.type == FLOAT:
  43. args_f[count_f] = box.getfloatstorage()
  44. count_f += 1
  45. # get the function address as an integer
  46. func = argboxes[0].getint()
  47. # do the call using the correct function from the cpu
  48. if rettype == INT:
  49. try:
  50. result = cpu.bh_call_i(func, args_i, args_r, args_f, descr)
  51. except Exception as e:
  52. metainterp.execute_raised(e)
  53. result = 0
  54. return result
  55. if rettype == REF:
  56. try:
  57. result = cpu.bh_call_r(func, args_i, args_r, args_f, descr)
  58. except Exception as e:
  59. metainterp.execute_raised(e)
  60. result = NULL
  61. return result
  62. if rettype == FLOAT:
  63. try:
  64. result = cpu.bh_call_f(func, args_i, args_r, args_f, descr)
  65. except Exception as e:
  66. metainterp.execute_raised(e)
  67. result = longlong.ZEROF
  68. return result
  69. if rettype == VOID:
  70. try:
  71. cpu.bh_call_v(func, args_i, args_r, args_f, descr)
  72. except Exception as e:
  73. metainterp.execute_raised(e)
  74. return None
  75. raise AssertionError("bad rettype")
  76. def new_do_call(rettype):
  77. def do_call(cpu, metainterp, argboxes, descr):
  78. return _do_call(cpu, metainterp, argboxes, descr, rettype)
  79. do_call.func_name = "do_call_" + rettype
  80. return do_call
  81. do_call_r = new_do_call("r")
  82. do_call_i = new_do_call("i")
  83. do_call_f = new_do_call("f")
  84. do_call_n = new_do_call("v")
  85. do_call_loopinvariant_r = do_call_r
  86. do_call_loopinvariant_i = do_call_i
  87. do_call_loopinvariant_f = do_call_f
  88. do_call_loopinvariant_n = do_call_n
  89. do_call_may_force_r = do_call_r
  90. do_call_may_force_i = do_call_i
  91. do_call_may_force_f = do_call_f
  92. do_call_may_force_n = do_call_n
  93. def do_cond_call(cpu, metainterp, argboxes, descr):
  94. condbox = argboxes[0]
  95. if condbox.getint():
  96. do_call_n(cpu, metainterp, argboxes[1:], descr)
  97. def do_getarrayitem_gc_i(cpu, _, arraybox, indexbox, arraydescr):
  98. array = arraybox.getref_base()
  99. index = indexbox.getint()
  100. return cpu.bh_getarrayitem_gc_i(array, index, arraydescr)
  101. def do_getarrayitem_gc_r(cpu, _, arraybox, indexbox, arraydescr):
  102. array = arraybox.getref_base()
  103. index = indexbox.getint()
  104. return cpu.bh_getarrayitem_gc_r(array, index, arraydescr)
  105. def do_getarrayitem_gc_f(cpu, _, arraybox, indexbox, arraydescr):
  106. array = arraybox.getref_base()
  107. index = indexbox.getint()
  108. return cpu.bh_getarrayitem_gc_f(array, index, arraydescr)
  109. def do_getarrayitem_raw_i(cpu, _, arraybox, indexbox, arraydescr):
  110. array = arraybox.getint()
  111. index = indexbox.getint()
  112. return cpu.bh_getarrayitem_raw_i(array, index, arraydescr)
  113. def do_getarrayitem_raw_f(cpu, _, arraybox, indexbox, arraydescr):
  114. array = arraybox.getint()
  115. index = indexbox.getint()
  116. return cpu.bh_getarrayitem_raw_f(array, index, arraydescr)
  117. def do_setarrayitem_gc(cpu, _, arraybox, indexbox, itembox, arraydescr):
  118. array = arraybox.getref_base()
  119. index = indexbox.getint()
  120. if arraydescr.is_array_of_pointers():
  121. cpu.bh_setarrayitem_gc_r(array, index, itembox.getref_base(),
  122. arraydescr)
  123. elif arraydescr.is_array_of_floats():
  124. cpu.bh_setarrayitem_gc_f(array, index, itembox.getfloatstorage(),
  125. arraydescr)
  126. else:
  127. cpu.bh_setarrayitem_gc_i(array, index, itembox.getint(), arraydescr)
  128. def do_setarrayitem_raw(cpu, _, arraybox, indexbox, itembox, arraydescr):
  129. array = arraybox.getint()
  130. index = indexbox.getint()
  131. assert not arraydescr.is_array_of_pointers()
  132. if arraydescr.is_array_of_floats():
  133. cpu.bh_setarrayitem_raw_f(array, index, itembox.getfloatstorage(),
  134. arraydescr)
  135. else:
  136. cpu.bh_setarrayitem_raw_i(array, index, itembox.getint(), arraydescr)
  137. def do_getinteriorfield_gc(cpu, _, arraybox, indexbox, descr):
  138. raise Exception("implement me")
  139. xxxx
  140. array = arraybox.getref_base()
  141. index = indexbox.getint()
  142. if descr.is_pointer_field():
  143. return BoxPtr(cpu.bh_getinteriorfield_gc_r(array, index, descr))
  144. elif descr.is_float_field():
  145. return BoxFloat(cpu.bh_getinteriorfield_gc_f(array, index, descr))
  146. else:
  147. return BoxInt(cpu.bh_getinteriorfield_gc_i(array, index, descr))
  148. def do_setinteriorfield_gc(cpu, _, arraybox, indexbox, valuebox, descr):
  149. array = arraybox.getref_base()
  150. index = indexbox.getint()
  151. if descr.is_pointer_field():
  152. cpu.bh_setinteriorfield_gc_r(array, index, valuebox.getref_base(),
  153. descr)
  154. elif descr.is_float_field():
  155. cpu.bh_setinteriorfield_gc_f(array, index, valuebox.getfloatstorage(),
  156. descr)
  157. else:
  158. cpu.bh_setinteriorfield_gc_i(array, index, valuebox.getint(), descr)
  159. def do_getfield_gc_i(cpu, _, structbox, fielddescr):
  160. struct = structbox.getref_base()
  161. return cpu.bh_getfield_gc_i(struct, fielddescr)
  162. def do_getfield_gc_r(cpu, _, structbox, fielddescr):
  163. struct = structbox.getref_base()
  164. return cpu.bh_getfield_gc_r(struct, fielddescr)
  165. def do_getfield_gc_f(cpu, _, structbox, fielddescr):
  166. struct = structbox.getref_base()
  167. return cpu.bh_getfield_gc_f(struct, fielddescr)
  168. def do_getfield_raw_i(cpu, _, structbox, fielddescr):
  169. check_descr(fielddescr)
  170. struct = structbox.getint()
  171. return cpu.bh_getfield_raw_i(struct, fielddescr)
  172. def do_getfield_raw_f(cpu, _, structbox, fielddescr):
  173. check_descr(fielddescr)
  174. struct = structbox.getint()
  175. return cpu.bh_getfield_raw_f(struct, fielddescr)
  176. def do_getfield_raw_r(cpu, _, structbox, fielddescr):
  177. check_descr(fielddescr)
  178. struct = structbox.getint()
  179. return cpu.bh_getfield_raw_r(struct, fielddescr)
  180. def do_setfield_gc(cpu, _, structbox, itembox, fielddescr):
  181. struct = structbox.getref_base()
  182. if fielddescr.is_pointer_field():
  183. cpu.bh_setfield_gc_r(struct, itembox.getref_base(), fielddescr)
  184. elif fielddescr.is_float_field():
  185. cpu.bh_setfield_gc_f(struct, itembox.getfloatstorage(), fielddescr)
  186. else:
  187. cpu.bh_setfield_gc_i(struct, itembox.getint(), fielddescr)
  188. def do_setfield_raw(cpu, _, structbox, itembox, fielddescr):
  189. struct = structbox.getint()
  190. assert not fielddescr.is_pointer_field()
  191. if fielddescr.is_float_field():
  192. cpu.bh_setfield_raw_f(struct, itembox.getfloatstorage(), fielddescr)
  193. else:
  194. cpu.bh_setfield_raw_i(struct, itembox.getint(), fielddescr)
  195. def do_raw_store(cpu, _, addrbox, offsetbox, valuebox, arraydescr):
  196. addr = addrbox.getint()
  197. offset = offsetbox.getint()
  198. if arraydescr.is_array_of_pointers():
  199. raise AssertionError("cannot store GC pointers in raw store")
  200. elif arraydescr.is_array_of_floats():
  201. cpu.bh_raw_store_f(addr, offset, valuebox.getfloatstorage(),arraydescr)
  202. else:
  203. cpu.bh_raw_store_i(addr, offset, valuebox.getint(), arraydescr)
  204. def do_raw_load(cpu, _, addrbox, offsetbox, arraydescr):
  205. raise Exception("implement me")
  206. xxx
  207. addr = addrbox.getint()
  208. offset = offsetbox.getint()
  209. if arraydescr.is_array_of_pointers():
  210. raise AssertionError("cannot store GC pointers in raw store")
  211. elif arraydescr.is_array_of_floats():
  212. return BoxFloat(cpu.bh_raw_load_f(addr, offset, arraydescr))
  213. else:
  214. return BoxInt(cpu.bh_raw_load_i(addr, offset, arraydescr))
  215. def exec_new_with_vtable(cpu, descr):
  216. return cpu.bh_new_with_vtable(descr)
  217. def do_new_with_vtable(cpu, _, clsbox):
  218. return exec_new_with_vtable(cpu, clsbox)
  219. def do_int_add_ovf(cpu, metainterp, box1, box2):
  220. # the overflow operations can be called without a metainterp, if an
  221. # overflow cannot occur
  222. a = box1.getint()
  223. b = box2.getint()
  224. try:
  225. z = ovfcheck(a + b)
  226. except OverflowError:
  227. assert metainterp is not None
  228. metainterp.ovf_flag = True
  229. z = 0
  230. return z
  231. def do_int_sub_ovf(cpu, metainterp, box1, box2):
  232. a = box1.getint()
  233. b = box2.getint()
  234. try:
  235. z = ovfcheck(a - b)
  236. except OverflowError:
  237. assert metainterp is not None
  238. metainterp.ovf_flag = True
  239. z = 0
  240. return z
  241. def do_int_mul_ovf(cpu, metainterp, box1, box2):
  242. a = box1.getint()
  243. b = box2.getint()
  244. try:
  245. z = ovfcheck(a * b)
  246. except OverflowError:
  247. assert metainterp is not None
  248. metainterp.ovf_flag = True
  249. z = 0
  250. return z
  251. def do_same_as_i(cpu, _, v):
  252. return v.getint()
  253. def do_same_as_r(cpu, _, v):
  254. return v.getref_base()
  255. def do_same_as_f(cpu, _, v):
  256. return v.getfloatstorage()
  257. def do_copystrcontent(cpu, _, srcbox, dstbox,
  258. srcstartbox, dststartbox, lengthbox):
  259. src = srcbox.getref(lltype.Ptr(rstr.STR))
  260. dst = dstbox.getref(lltype.Ptr(rstr.STR))
  261. srcstart = srcstartbox.getint()
  262. dststart = dststartbox.getint()
  263. length = lengthbox.getint()
  264. rstr.copy_string_contents(src, dst, srcstart, dststart, length)
  265. def do_copyunicodecontent(cpu, _, srcbox, dstbox,
  266. srcstartbox, dststartbox, lengthbox):
  267. src = srcbox.getref(lltype.Ptr(rstr.UNICODE))
  268. dst = dstbox.getref(lltype.Ptr(rstr.UNICODE))
  269. srcstart = srcstartbox.getint()
  270. dststart = dststartbox.getint()
  271. length = lengthbox.getint()
  272. rstr.copy_unicode_contents(src, dst, srcstart, dststart, length)
  273. def do_keepalive(cpu, _, x):
  274. pass
  275. # ____________________________________________________________
  276. def _make_execute_list():
  277. execute_by_num_args = {}
  278. for key in opname.values():
  279. value = getattr(rop, key)
  280. if not key.startswith('_'):
  281. if (rop._FINAL_FIRST <= value <= rop._FINAL_LAST or
  282. rop._GUARD_FIRST <= value <= rop._GUARD_LAST):
  283. continue
  284. # find which list to store the operation in, based on num_args
  285. num_args = resoperation.oparity[value]
  286. withdescr = resoperation.opwithdescr[value]
  287. dictkey = num_args, withdescr
  288. if dictkey not in execute_by_num_args:
  289. execute_by_num_args[dictkey] = [None] * (rop._LAST+1)
  290. execute = execute_by_num_args[dictkey]
  291. #
  292. if execute[value] is not None:
  293. raise AssertionError("duplicate entry for op number %d"% value)
  294. #
  295. # Fish for a way for the pyjitpl interpreter to delegate
  296. # really running the operation to the blackhole interpreter
  297. # or directly to the cpu. First try the do_xxx() functions
  298. # explicitly encoded above:
  299. name = 'do_' + key.lower()
  300. if name in globals():
  301. execute[value] = globals()[name]
  302. continue
  303. #
  304. # Maybe the same without the _PURE suffix?
  305. if key[-7:-2] == '_PURE':
  306. key = key[:-7] + key[-2:]
  307. name = 'do_' + key.lower()
  308. if name in globals():
  309. execute[value] = globals()[name]
  310. continue
  311. #
  312. # If missing, fallback to the bhimpl_xxx() method of the
  313. # blackhole interpreter. This only works if there is a
  314. # method of the exact same name and it accepts simple
  315. # parameters.
  316. name = 'bhimpl_' + key.lower()
  317. if hasattr(BlackholeInterpreter, name):
  318. func = make_execute_function(
  319. key.lower(),
  320. getattr(BlackholeInterpreter, name).im_func)
  321. if func is not None:
  322. execute[value] = func
  323. continue
  324. if value in (rop.FORCE_TOKEN,
  325. rop.CALL_ASSEMBLER_R,
  326. rop.CALL_ASSEMBLER_F,
  327. rop.CALL_ASSEMBLER_I,
  328. rop.CALL_ASSEMBLER_N,
  329. rop.INCREMENT_DEBUG_COUNTER,
  330. rop.COND_CALL_GC_WB,
  331. rop.COND_CALL_GC_WB_ARRAY,
  332. rop.ZERO_ARRAY,
  333. rop.DEBUG_MERGE_POINT,
  334. rop.JIT_DEBUG,
  335. rop.ENTER_PORTAL_FRAME,
  336. rop.LEAVE_PORTAL_FRAME,
  337. rop.SETARRAYITEM_RAW,
  338. rop.SETINTERIORFIELD_RAW,
  339. rop.CALL_RELEASE_GIL_I,
  340. rop.CALL_RELEASE_GIL_F,
  341. rop.CALL_RELEASE_GIL_N,
  342. rop.QUASIIMMUT_FIELD,
  343. rop.CHECK_MEMORY_ERROR,
  344. rop.CALL_MALLOC_NURSERY,
  345. rop.CALL_MALLOC_NURSERY_VARSIZE,
  346. rop.CALL_MALLOC_NURSERY_VARSIZE_FRAME,
  347. rop.NURSERY_PTR_INCREMENT,
  348. rop.LABEL,
  349. rop.ESCAPE_I,
  350. rop.ESCAPE_N,
  351. rop.ESCAPE_R,
  352. rop.ESCAPE_F,
  353. rop.FORCE_SPILL,
  354. rop.SAVE_EXC_CLASS,
  355. rop.SAVE_EXCEPTION,
  356. rop.RESTORE_EXCEPTION,
  357. rop.VEC_RAW_LOAD_I,
  358. rop.VEC_RAW_LOAD_F,
  359. rop.VEC_RAW_STORE,
  360. rop.VEC_GETARRAYITEM_RAW_I,
  361. rop.VEC_GETARRAYITEM_RAW_F,
  362. rop.VEC_SETARRAYITEM_RAW,
  363. rop.VEC_GETARRAYITEM_GC_I,
  364. rop.VEC_GETARRAYITEM_GC_F,
  365. rop.VEC_SETARRAYITEM_GC,
  366. rop.GC_LOAD_I,
  367. rop.GC_LOAD_R,
  368. rop.GC_LOAD_F,
  369. rop.GC_LOAD_INDEXED_R,
  370. rop.GC_STORE,
  371. rop.GC_STORE_INDEXED,
  372. rop.LOAD_FROM_GC_TABLE,
  373. ): # list of opcodes never executed by pyjitpl
  374. continue
  375. if rop._VEC_PURE_FIRST <= value <= rop._VEC_PURE_LAST:
  376. continue
  377. raise AssertionError("missing %r" % (key,))
  378. return execute_by_num_args
  379. def make_execute_function(name, func):
  380. # Make a wrapper for 'func'. The func is a simple bhimpl_xxx function
  381. # from the BlackholeInterpreter class. The wrapper is a new function
  382. # that receives boxed values (but returns a non-boxed value).
  383. for argtype in func.argtypes:
  384. if argtype not in ('i', 'r', 'f', 'd', 'cpu'):
  385. return None
  386. if list(func.argtypes).count('d') > 1:
  387. return None
  388. argtypes = unrolling_iterable(func.argtypes)
  389. #
  390. def do(cpu, _, *argboxes):
  391. newargs = ()
  392. for argtype in argtypes:
  393. if argtype == 'cpu':
  394. value = cpu
  395. elif argtype == 'd':
  396. value = argboxes[-1]
  397. assert isinstance(value, AbstractDescr)
  398. argboxes = argboxes[:-1]
  399. else:
  400. argbox = argboxes[0]
  401. argboxes = argboxes[1:]
  402. if argtype == 'i': value = argbox.getint()
  403. elif argtype == 'r': value = argbox.getref_base()
  404. elif argtype == 'f': value = argbox.getfloatstorage()
  405. newargs = newargs + (value,)
  406. assert not argboxes
  407. #
  408. return func(*newargs)
  409. #
  410. do.func_name = 'do_' + name
  411. return do
  412. def get_execute_funclist(num_args, withdescr):
  413. # workaround, similar to the next one
  414. return EXECUTE_BY_NUM_ARGS[num_args, withdescr]
  415. get_execute_funclist._annspecialcase_ = 'specialize:memo'
  416. def get_execute_function(opnum, num_args, withdescr):
  417. # workaround for an annotation limitation: putting this code in
  418. # a specialize:memo function makes sure the following line is
  419. # constant-folded away. Only works if opnum and num_args are
  420. # constants, of course.
  421. func = EXECUTE_BY_NUM_ARGS[num_args, withdescr][opnum]
  422. #assert func is not None, "EXECUTE_BY_NUM_ARGS[%s, %s][%s]" % (
  423. # num_args, withdescr, resoperation.opname[opnum])
  424. return func
  425. get_execute_function._annspecialcase_ = 'specialize:memo'
  426. def has_descr(opnum):
  427. # workaround, similar to the previous one
  428. return resoperation.opwithdescr[opnum]
  429. has_descr._annspecialcase_ = 'specialize:memo'
  430. def execute(cpu, metainterp, opnum, descr, *argboxes):
  431. # only for opnums with a fixed arity
  432. num_args = len(argboxes)
  433. withdescr = has_descr(opnum)
  434. if withdescr:
  435. check_descr(descr)
  436. argboxes = argboxes + (descr,)
  437. else:
  438. assert descr is None
  439. func = get_execute_function(opnum, num_args, withdescr)
  440. return func(cpu, metainterp, *argboxes) # note that the 'argboxes' tuple
  441. # optionally ends with the descr
  442. execute._annspecialcase_ = 'specialize:arg(2)'
  443. def execute_varargs(cpu, metainterp, opnum, argboxes, descr):
  444. # only for opnums with a variable arity (calls, typically)
  445. check_descr(descr)
  446. func = get_execute_function(opnum, -1, True)
  447. return func(cpu, metainterp, argboxes, descr)
  448. execute_varargs._annspecialcase_ = 'specialize:arg(2)'
  449. @specialize.argtype(0)
  450. def wrap_constant(value):
  451. if lltype.typeOf(value) == lltype.Signed:
  452. return ConstInt(value)
  453. elif isinstance(value, bool):
  454. return ConstInt(int(value))
  455. elif lltype.typeOf(value) == longlong.FLOATSTORAGE:
  456. return ConstFloat(value)
  457. elif isinstance(value, float):
  458. return ConstFloat(longlong.getfloatstorage(value))
  459. else:
  460. assert lltype.typeOf(value) == llmemory.GCREF
  461. return ConstPtr(value)
  462. def constant_from_op(op):
  463. if op.type == 'i':
  464. return ConstInt(op.getint())
  465. elif op.type == 'r':
  466. return ConstPtr(op.getref_base())
  467. else:
  468. assert op.type == 'f'
  469. return ConstFloat(op.getfloatstorage())
  470. unrolled_range = unrolling_iterable(range(rop._LAST))
  471. def execute_nonspec_const(cpu, metainterp, opnum, argboxes, descr=None,
  472. type='i'):
  473. for num in unrolled_range:
  474. if num == opnum:
  475. return wrap_constant(_execute_arglist(cpu, metainterp, num,
  476. argboxes, descr))
  477. assert False
  478. @specialize.arg(2)
  479. def _execute_arglist(cpu, metainterp, opnum, argboxes, descr=None):
  480. arity = resoperation.oparity[opnum]
  481. assert arity == -1 or len(argboxes) == arity
  482. if resoperation.opwithdescr[opnum]:
  483. check_descr(descr)
  484. if arity == -1:
  485. func = get_execute_function(opnum, -1, True)
  486. if func:
  487. return func(cpu, metainterp, argboxes, descr)
  488. if arity == 0:
  489. func = get_execute_function(opnum, 0, True)
  490. if func:
  491. return func(cpu, metainterp, descr)
  492. if arity == 1:
  493. func = get_execute_function(opnum, 1, True)
  494. if func:
  495. return func(cpu, metainterp, argboxes[0], descr)
  496. if arity == 2:
  497. func = get_execute_function(opnum, 2, True)
  498. if func:
  499. return func(cpu, metainterp, argboxes[0], argboxes[1], descr)
  500. if arity == 3:
  501. func = get_execute_function(opnum, 3, True)
  502. if func:
  503. return func(cpu, metainterp, argboxes[0], argboxes[1],
  504. argboxes[2], descr)
  505. else:
  506. assert descr is None
  507. if arity == 1:
  508. func = get_execute_function(opnum, 1, False)
  509. if func:
  510. return func(cpu, metainterp, argboxes[0])
  511. if arity == 2:
  512. func = get_execute_function(opnum, 2, False)
  513. if func:
  514. return func(cpu, metainterp, argboxes[0], argboxes[1])
  515. if arity == 3:
  516. func = get_execute_function(opnum, 3, False)
  517. if func:
  518. return func(cpu, metainterp, argboxes[0], argboxes[1],
  519. argboxes[2])
  520. if arity == 5: # copystrcontent, copyunicodecontent
  521. func = get_execute_function(opnum, 5, False)
  522. if func:
  523. return func(cpu, metainterp, argboxes[0], argboxes[1],
  524. argboxes[2], argboxes[3], argboxes[4])
  525. raise NotImplementedError
  526. EXECUTE_BY_NUM_ARGS = _make_execute_list()