Skip to content

Commit

Permalink
Fix type profiling of BINARY_SUBSCR_TUPLE_CONST_INT
Browse files Browse the repository at this point in the history
Summary:
This shadow bytecode has 1 fewer input than we would expect of BINARY_SUBSCR, it
stores the (constant int) index in its oparg field rather than on the stack.

Reviewed By: swtaarrs

Differential Revision: D49900672

fbshipit-source-id: a674d7125a2425f1711e41e359adba40229224b3
  • Loading branch information
Alex Malyshev authored and facebook-github-bot committed Oct 10, 2023
1 parent 25ce292 commit caf9713
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Jit/profile_runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ void ProfileRuntime::profileInstr(
case BINARY_SUBSCR_DICT_STR:
case BINARY_SUBSCR_LIST:
case BINARY_SUBSCR_TUPLE:
case BINARY_SUBSCR_TUPLE_CONST_INT:
case STORE_ATTR_DESCR:
case STORE_ATTR_DICT:
case STORE_ATTR_SLOT:
Expand All @@ -352,6 +351,11 @@ void ProfileRuntime::profileInstr(
case STORE_PRIMITIVE_FIELD:
profile_stack(1, 0);
break;
case BINARY_SUBSCR_TUPLE_CONST_INT:
// This instruction replaces a LOAD_CONST and a BINARY_SUBSCR. The index
// field is stored within the oparg instead of on the stack.
profile_stack(0);
break;
}
}

Expand Down

0 comments on commit caf9713

Please sign in to comment.