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

Unified Diff: vm/intermediate_language.cc

Issue 10825035: Add an explicit push-argument instruction to the IL. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 5 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.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/intermediate_language.cc
===================================================================
--- vm/intermediate_language.cc (revision 9930)
+++ vm/intermediate_language.cc (working copy)
@@ -126,11 +126,6 @@
}
-intptr_t ClosureCallComp::InputCount() const {
- return ArgumentCount();
-}
-
-
intptr_t AllocateObjectComp::InputCount() const {
return arguments().length();
}
@@ -268,6 +263,27 @@
}
+intptr_t PushArgumentInstr::InputCount() const {
+ return 1;
+}
+
+
+Value* PushArgumentInstr::InputAt(intptr_t i) const {
+ if (i == 0) return value();
+ UNREACHABLE();
+ return NULL;
+}
+
+
+void PushArgumentInstr::SetInputAt(intptr_t i, Value* value) {
+ if (i == 0) {
+ value_ = value;
+ return;
+ }
+ UNREACHABLE();
+}
+
+
intptr_t ReturnInstr::InputCount() const {
return 1;
}
@@ -1115,7 +1131,6 @@
void ClosureCallComp::EmitNativeCode(FlowGraphCompiler* compiler) {
- ASSERT(VerifyCallComputation(this));
// The arguments to the stub include the closure. The arguments
// descriptor describes the closure's arguments (and so does not include
// the closure).
@@ -1304,6 +1319,29 @@
}
+LocationSummary* PushArgumentInstr::MakeLocationSummary() const {
+ const intptr_t kNumInputs = 1;
+ const intptr_t kNumTemps= 0;
+ LocationSummary* locs = new LocationSummary(kNumInputs, kNumTemps);
+ // TODO(fschneider): Use Any() once it is supported by all code generators.
+ locs->set_in(0, Location::RequiresRegister());
+ return locs;
+}
+
+
+void PushArgumentInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ // In SSA mode, we need an explicit push. Nothing to do in non-SSA mode
+ // where PushArgument is handled in FrameRegisterAllocator::AllocateRegisters.
+ // Instead of popping the value it is left alone on the simulated frame
+ // and materialized on the physical stack before the call.
+ // TODO(fschneider): Avoid special-casing for SSA mode here.
+ if (compiler->is_ssa()) {
+ ASSERT(locs()->in(0).IsRegister());
+ __ PushRegister(locs()->in(0).reg());
+ }
+}
+
+
#undef __
} // namespace dart
« no previous file with comments | « vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698