Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion py/vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,17 @@ MP_NOINLINE static mp_obj_t *build_slice_stack_allocated(byte op, mp_obj_t *sp,
}
#endif

#ifdef USE_YK
// Elide instruction lookup.
//
// FIXME: Can the bytecode be mutated? If so we would need to add and promote a
// bytecode version tag (see yklua for an example).
__attribute__((yk_idempotent))
byte load_inst(const byte *pc) {
return *pc;
}
#endif

// fastn has items in reverse order (fastn[0] is local[0], fastn[-1] is local[1], etc)
// sp points to bottom of stack which grows up
// returns:
Expand Down Expand Up @@ -339,8 +350,12 @@ FRAME_SETUP();
#ifdef USE_YK
mp_uint_t locidx = ip - code_state->fun_bc->bytecode;
yk_mt_control_point(mp_state_ctx.ykmt, &yklocs[locidx]);
ip = (const byte *) yk_promote((void *) ip);
byte opcode = load_inst(ip++);
#else
byte opcode = *ip++;
#endif
switch (*ip++) {
switch (opcode) {
#endif

ENTRY(MP_BC_LOAD_CONST_FALSE):
Expand Down