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

Unified Diff: runtime/vm/intermediate_language_x64.cc

Issue 181183004: VM: Improve receiver class check in polymorphic inlining. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: improved polymorphic ClassCheck ia32 Created 6 years, 10 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_x64.cc
===================================================================
--- runtime/vm/intermediate_language_x64.cc (revision 33059)
+++ runtime/vm/intermediate_language_x64.cc (working copy)
@@ -4721,6 +4721,33 @@
}
+LocationSummary* CheckClassIdInstr::MakeLocationSummary(bool opt) const {
+ const intptr_t kNumInputs = 2;
+ const intptr_t kNumTemps = 0;
+ LocationSummary* summary =
+ new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ summary->set_in(0, Location::RequiresRegister());
+ summary->set_in(1, Location::RegisterOrSmiConstant(right()));
+ return summary;
+}
+
+
+void CheckClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ Register left = locs()->in(0).reg();
+ Location right = locs()->in(1);
+ Label* deopt = compiler->AddDeoptStub(deopt_id(), kDeoptCheckClass);
+ if (right.IsRegister()) {
+ __ cmpq(left, right.reg());
+ } else {
+ ASSERT(right.IsConstant());
+ const Object& right_const = Smi::Cast(right.constant());
+ __ CompareImmediate(
+ left, Immediate(reinterpret_cast<int64_t>(right_const.raw())), PP);
+ }
+ __ j(NOT_ZERO, deopt);
+}
+
+
LocationSummary* CheckArrayBoundInstr::MakeLocationSummary(bool opt) const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
« runtime/vm/intermediate_language.h ('K') | « runtime/vm/intermediate_language_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698