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..e0db8f0db5e483f017d33186af07daf6c56abe62 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,37 @@ DEFINE_UNIMPLEMENTED_EMIT_BRANCH_CODE(RelationalOp) |
| DEFINE_UNIMPLEMENTED_EMIT_BRANCH_CODE(EqualityCompare) |
| +DEFINE_MAKE_LOCATION_SUMMARY(InstanceOf, 2, |
| + Location::SameAsFirstInput(), |
| + LocationSummary::kCall); |
| + |
| + |
| +void InstanceOfInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| + if (compiler->is_optimizing()) { |
| + __ Push(locs()->in(0).reg()); // Value. |
| + __ Push(locs()->in(1).reg()); // Instantiator type arguments. |
| + } |
| + |
| + const SubtypeTestCache& cache = |
| + SubtypeTestCache::ZoneHandle(SubtypeTestCache::New()); |
| + |
| + __ PushConstant(type()); |
| + __ PushConstant(cache); |
| + __ InstanceOf(); |
| + compiler->RecordSafepoint(locs()); |
| + compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, |
| + deopt_id(), |
| + token_pos()); |
| + if (negate_result()) { |
|
zra
2016/06/28 19:28:05
I think we should fold this into the InstanceOf in
rmacnak
2016/06/28 21:21:50
Done.
|
| + __ LogicalNot(); |
| + } |
| + |
| + if (compiler->is_optimizing()) { |
| + __ PopLocal(locs()->out(0).reg()); |
| + } |
| +} |
| + |
| + |
| DEFINE_MAKE_LOCATION_SUMMARY(AssertAssignable, 2, |
| Location::SameAsFirstInput(), |
| LocationSummary::kCall); |