Chromium Code Reviews| Index: runtime/vm/intermediate_language_dbc.cc |
| diff --git a/runtime/vm/intermediate_language_dbc.cc b/runtime/vm/intermediate_language_dbc.cc |
| index d28bbb2c30aff544c47e1e37ad46739edb5d8879..93fcc6c44f6a02b3ddd7230d2be82524face077a 100644 |
| --- a/runtime/vm/intermediate_language_dbc.cc |
| +++ b/runtime/vm/intermediate_language_dbc.cc |
| @@ -32,7 +32,6 @@ DECLARE_FLAG(int, optimization_counter_threshold); |
| #define FOR_EACH_UNIMPLEMENTED_INSTRUCTION(M) \ |
| M(IndirectGoto) \ |
| M(LoadCodeUnits) \ |
| - M(InstanceOf) \ |
| M(LoadUntagged) \ |
| M(AllocateUninitializedContext) \ |
| M(BinaryInt32Op) \ |
| @@ -179,6 +178,36 @@ DEFINE_UNIMPLEMENTED_EMIT_BRANCH_CODE(RelationalOp) |
| DEFINE_UNIMPLEMENTED_EMIT_BRANCH_CODE(EqualityCompare) |
| +DEFINE_MAKE_LOCATION_SUMMARY(InstanceOf, 2, |
|
zra
2016/06/28 21:37:47
This can just be
EMIT_NATIVE_CODE(InstanceOf, 2,
rmacnak
2016/06/28 22:22:55
Done.
|
| + Location::SameAsFirstInput(), |
| + LocationSummary::kCall); |
| + |
| + |
| +void InstanceOfInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| + SubtypeTestCache& test_cache = SubtypeTestCache::Handle(); |
| + if (!type().IsVoidType() && type().IsInstantiated()) { |
| + test_cache = SubtypeTestCache::New(); |
| + } |
| + |
| + if (compiler->is_optimizing()) { |
| + __ Push(locs()->in(0).reg()); // Value. |
| + __ Push(locs()->in(1).reg()); // Instantiator type arguments. |
| + } |
| + |
| + __ PushConstant(type()); |
| + __ PushConstant(test_cache); |
| + __ InstanceOf(negate_result() ? 1 : 0); |
| + compiler->RecordSafepoint(locs()); |
| + compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, |
| + deopt_id(), |
| + token_pos()); |
| + |
| + if (compiler->is_optimizing()) { |
| + __ PopLocal(locs()->out(0).reg()); |
| + } |
| +} |
| + |
| + |
| DEFINE_MAKE_LOCATION_SUMMARY(AssertAssignable, 2, |
| Location::SameAsFirstInput(), |
| LocationSummary::kCall); |