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

Unified Diff: runtime/vm/intermediate_language_ia32.cc

Issue 10911057: Add check for non-smi to the IL and use it for class checks. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_ia32.cc
===================================================================
--- runtime/vm/intermediate_language_ia32.cc (revision 11768)
+++ runtime/vm/intermediate_language_ia32.cc (working copy)
@@ -2100,8 +2100,6 @@
Label* deopt = compiler->AddDeoptStub(deopt_id(),
kDeoptCheckClass);
ASSERT(unary_checks().GetReceiverClassIdAt(0) != kSmiCid);
- __ testl(value, Immediate(kSmiTagMask));
- __ j(ZERO, deopt);
__ LoadClassId(temp, value);
Label is_ok;
const intptr_t num_checks = unary_checks().NumberOfChecks();
@@ -2134,13 +2132,30 @@
void CheckSmiComp::EmitNativeCode(FlowGraphCompiler* compiler) {
Register value = locs()->in(0).reg();
- Label* deopt = compiler->AddDeoptStub(deopt_id(),
- kDeoptCheckSmi);
+ Label* deopt = compiler->AddDeoptStub(deopt_id(), kDeoptCheckSmi);
__ testl(value, Immediate(kSmiTagMask));
__ j(NOT_ZERO, deopt);
}
+LocationSummary* CheckNonSmiComp::MakeLocationSummary() const {
+ const intptr_t kNumInputs = 1;
+ const intptr_t kNumTemps = 0;
+ LocationSummary* summary =
+ new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ summary->set_in(0, Location::RequiresRegister());
+ return summary;
+}
+
+
+void CheckNonSmiComp::EmitNativeCode(FlowGraphCompiler* compiler) {
+ Register value = locs()->in(0).reg();
+ Label* deopt = compiler->AddDeoptStub(deopt_id(), kDeoptCheckNonSmi);
+ __ testl(value, Immediate(kSmiTagMask));
+ __ j(ZERO, deopt);
+}
+
+
LocationSummary* CheckArrayBoundComp::MakeLocationSummary() const {
return LocationSummary::Make(2,
Location::NoLocation(),
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698