Skip to content

Commit cd7f8fd

Browse files
committed
Add asm interpreter implementation of LOAD_ATTR_INSTANCE_TYPE
This brings it down from 19727 to 4101 transitions from asm to C++.
1 parent aaba3fa commit cd7f8fd

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

runtime/interpreter-gen-x64.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,29 @@ void emitHandler<LOAD_ATTR_INSTANCE_SLOT_DESCR>(EmitEnv* env) {
12481248
emitJumpToGenericHandler(env);
12491249
}
12501250

1251+
template <>
1252+
void emitHandler<LOAD_ATTR_INSTANCE_TYPE>(EmitEnv* env) {
1253+
ScratchReg r_base(env);
1254+
ScratchReg r_layout_id(env);
1255+
ScratchReg r_cached(env);
1256+
ScratchReg r_caches(env);
1257+
Label slow_path;
1258+
__ popq(r_base);
1259+
emitGetLayoutId(env, r_layout_id, r_base);
1260+
__ movq(r_caches, Address(env->frame, Frame::kCachesOffset));
1261+
emitIcLookupMonomorphic(env, &slow_path, r_cached, r_layout_id, r_caches);
1262+
__ pushq(r_cached);
1263+
emitNextOpcode(env);
1264+
1265+
__ bind(&slow_path);
1266+
__ pushq(r_base);
1267+
if (env->in_jit) {
1268+
emitJumpToDeopt(env);
1269+
return;
1270+
}
1271+
emitJumpToGenericHandler(env);
1272+
}
1273+
12511274
template <>
12521275
void emitHandler<LOAD_ATTR_INSTANCE_TYPE_BOUND_METHOD>(EmitEnv* env) {
12531276
ScratchReg r_base(env);

0 commit comments

Comments
 (0)