def get_location_str(greenkey): greenargs = unwrap_greenkey(greenkey) fn = support.maybe_on_top_of_llinterp(rtyper, get_location_ptr) res = fn(*greenargs) if not we_are_translated() and not isinstance(res, str): res = hlstr(res) return res
def ll_portal_runner(*args): while 1: try: return support.maybe_on_top_of_llinterp( rtyper, portal_ptr)(*args) except ContinueRunningNormally, e: args = () for _, name, _ in portalfunc_ARGS: v = getattr(e, name) args = args + (v, ) except DoneWithThisFrameVoid: assert result_kind == 'void' return
def ll_portal_runner(*args): while 1: try: return support.maybe_on_top_of_llinterp(rtyper, portal_ptr)(*args) except ContinueRunningNormally, e: args = () for _, name, _ in portalfunc_ARGS: v = getattr(e, name) args = args + (v,) except DoneWithThisFrameVoid: assert result_kind == 'void' return
def get_jitcell(*greenargs): fn = support.maybe_on_top_of_llinterp(rtyper, get_jitcell_at_ptr) cellref = fn(*greenargs) # <hacks> if we_are_translated(): BASEJITCELL = lltype.typeOf(cellref) cell = cast_base_ptr_to_instance(JitCell, cellref) elif isinstance(cellref, (BaseJitCell, type(None))): BASEJITCELL = None cell = cellref else: BASEJITCELL = lltype.typeOf(cellref) if cellref: cell = lltohlhack[rtyper.type_system.deref(cellref)] else: cell = None # </hacks> if cell is None: cell = JitCell() # <hacks> if we_are_translated(): cellref = cast_object_to_ptr(BASEJITCELL, cell) elif BASEJITCELL is None: cellref = cell else: if isinstance(BASEJITCELL, lltype.Ptr): cellref = lltype.malloc(BASEJITCELL.TO) elif isinstance(BASEJITCELL, ootype.Instance): cellref = ootype.new(BASEJITCELL) else: assert False, "no clue" lltohlhack[rtyper.type_system.deref(cellref)] = cell # </hacks> fn = support.maybe_on_top_of_llinterp(rtyper, set_jitcell_at_ptr) fn(cellref, *greenargs) return cell
def confirm_enter_jit(*args): fn = support.maybe_on_top_of_llinterp(rtyper, confirm_enter_jit_ptr) return fn(*args)
def can_inline_callable(*greenargs): fn = support.maybe_on_top_of_llinterp(rtyper, can_inline_ptr) return fn(*greenargs)
def can_inline_callable(greenkey): greenargs = unwrap_greenkey(greenkey) fn = support.maybe_on_top_of_llinterp(rtyper, can_inline_ptr) return fn(*greenargs)