Index: runtime/vm/intermediate_language_dbc.cc |
diff --git a/runtime/vm/intermediate_language_dbc.cc b/runtime/vm/intermediate_language_dbc.cc |
index 4af998e6a78edb5d9df89bc7aea2ed1ca7584bb1..3212027d030f8a4a4bbf909f87f62c99854f4596 100644 |
--- a/runtime/vm/intermediate_language_dbc.cc |
+++ b/runtime/vm/intermediate_language_dbc.cc |
@@ -108,10 +108,9 @@ DECLARE_FLAG(int, optimization_counter_threshold); |
M(UnboxInteger32) \ |
M(CheckedSmiOp) \ |
M(CheckArrayBound) \ |
- M(CheckSmi) \ |
+ M(BinarySmiOp) \ |
M(CheckClassId) \ |
M(CheckClass) \ |
- M(BinarySmiOp) \ |
M(TestSmi) \ |
M(RelationalOp) \ |
M(EqualityCompare) \ |
@@ -850,8 +849,12 @@ Representation LoadIndexedInstr::representation() const { |
Representation StoreIndexedInstr::RequiredInputRepresentation( |
intptr_t idx) const { |
// Array can be a Dart object or a pointer to external data. |
- if (idx == 0) return kNoRepresentation; // Flexible input representation. |
- if (idx == 1) return kTagged; // Index is a smi. |
+ if (idx == 0) { |
+ return kNoRepresentation; // Flexible input representation. |
+ } |
+ if (idx == 1) { |
+ return kTagged; // Index is a smi. |
+ } |
ASSERT(idx == 2); |
switch (class_id_) { |
case kArrayCid: |
@@ -903,6 +906,17 @@ void Environment::DropArguments(intptr_t argc) { |
} |
+EMIT_NATIVE_CODE(CheckSmi, 1) { |
+ Label* deopt = compiler->AddDeoptStub(deopt_id(), |
+ ICData::kDeoptCheckSmi, |
+ licm_hoisted_ ? ICData::kHoisted : 0); |
+ __ Push(locs()->in(0).reg()); |
zra
2016/06/07 22:31:28
Thoughts about adding an instruction for this that
Vyacheslav Egorov (Google)
2016/06/08 11:58:53
Yes, I think this should be just a special bytecod
zra
2016/06/08 17:46:30
Done.
|
+ __ LoadClassIdTOS(); |
+ __ PushConstant(Smi::Handle(Smi::New(kSmiCid))); |
+ __ IfNeStrictTOS(); |
+ __ Jump(deopt); |
Vyacheslav Egorov (Google)
2016/06/08 11:58:53
__ Jump(deopt) could just be __ Deopt(...)
zra
2016/06/08 17:46:30
Done.
|
+} |
+ |
} // namespace dart |
#endif // defined TARGET_ARCH_DBC |