Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(838)

Unified Diff: runtime/vm/intermediate_language_dbc.cc

Issue 2039913006: DBC: Eager deoptimization and CheckSmi instruction. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698