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

Unified Diff: vm/intermediate_language_x64.cc

Issue 10416025: Add a location summary to LoadLocal, StoreLocal and ConstantVal. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 7 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 | « vm/intermediate_language_ia32.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/intermediate_language_x64.cc
===================================================================
--- vm/intermediate_language_x64.cc (revision 7865)
+++ vm/intermediate_language_x64.cc (working copy)
@@ -139,12 +139,52 @@
}
+LocationSummary* LoadLocalComp::MakeLocationSummary() {
+ return MakeSimpleLocationSummary(0, Location::RequiresRegister());
+}
+
+
+void LoadLocalComp::EmitNativeCode(FlowGraphCompiler* compiler) {
+ Register result = locs()->out().reg();
+ __ movq(result, Address(RBP, local().index() * kWordSize));
+}
+
+
+LocationSummary* StoreLocalComp::MakeLocationSummary() {
+ return MakeSimpleLocationSummary(1, Location::SameAsFirstInput());
+}
+
+
+void StoreLocalComp::EmitNativeCode(FlowGraphCompiler* compiler) {
+ Register value = locs()->in(0).reg();
+ Register result = locs()->out().reg();
+ ASSERT(result == value); // Assert that register assignment is correct.
+ __ movq(Address(RBP, local().index() * kWordSize), value);
+}
+
+
void BindInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
computation()->EmitNativeCode(compiler);
__ pushq(locs()->out().reg());
}
+LocationSummary* ConstantVal::MakeLocationSummary() {
+ return MakeSimpleLocationSummary(0, Location::RequiresRegister());
+}
+
+
+void ConstantVal::EmitNativeCode(FlowGraphCompiler* compiler) {
+ Register result = locs()->out().reg();
+ if (value().IsSmi()) {
+ int64_t imm = reinterpret_cast<int64_t>(value().raw());
+ __ movq(result, Immediate(imm));
+ } else {
+ __ LoadObject(result, value());
+ }
+}
+
+
} // namespace dart
#undef __
« no previous file with comments | « vm/intermediate_language_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698