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

Unified Diff: runtime/vm/flow_graph_compiler_x64.cc

Issue 9588001: Remove an unneeded temp in instance setters and indexed stores. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_x64.cc
diff --git a/runtime/vm/flow_graph_compiler_x64.cc b/runtime/vm/flow_graph_compiler_x64.cc
index 34d4596d50beec2526e09f4a56f05afe50dcfb55..7ffc8a14050f4feabe3dcea4ab9b0b3698865f57 100644
--- a/runtime/vm/flow_graph_compiler_x64.cc
+++ b/runtime/vm/flow_graph_compiler_x64.cc
@@ -181,10 +181,15 @@ void FlowGraphCompiler::VisitStoreIndexed(StoreIndexedComp* comp) {
// arguments as the result of the computation.
const String& function_name =
String::ZoneHandle(String::NewSymbol(Token::Str(Token::kASSIGN_INDEX)));
- // Placeholder is under value, index, and receiver.
- const int kPlaceholderOffset = 3 * kWordSize;
- __ movq(RAX, Address(RSP, 0)); // Value.
- __ movq(Address(RSP, kPlaceholderOffset), RAX);
+
+ // Insert a copy of the third (last) argument under the arguments.
+ __ popq(RAX); // Value.
+ __ popq(RBX); // Index.
+ __ popq(RCX); // Receiver.
+ __ pushq(RAX);
+ __ pushq(RCX);
+ __ pushq(RBX);
+ __ pushq(RAX);
EmitInstanceCall(comp->node_id(), comp->token_index(), function_name, 3,
Array::ZoneHandle(), 1);
__ popq(RAX);
@@ -196,10 +201,13 @@ void FlowGraphCompiler::VisitInstanceSetter(InstanceSetterComp* comp) {
// computation, then call the getter.
const String& function_name =
String::ZoneHandle(Field::SetterSymbol(comp->field_name()));
- // Placeholder is under value and receiver.
- const int kPlaceholderOffset = 2 * kWordSize;
- __ movq(RAX, Address(RSP, 0)); // Value.
- __ movq(Address(RSP, kPlaceholderOffset), RAX);
+
+ // Insert a copy of the second (last) argument under the arguments.
+ __ popq(RAX); // Value.
+ __ popq(RBX); // Reciever.
+ __ pushq(RAX);
+ __ pushq(RBX);
+ __ pushq(RAX);
EmitInstanceCall(comp->node_id(), comp->token_index(), function_name, 2,
Array::ZoneHandle(), 1);
__ popq(RAX);
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698