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

Unified Diff: runtime/vm/flow_graph_builder.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 | « no previous file | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index 6ca201deeefb4f2d9084d1128758db9eb6d56aa6..2865352efc0385a7c980438e3fc46b8e1e7ba4bf 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -471,18 +471,13 @@ void EffectGraphVisitor::VisitInstanceGetterNode(InstanceGetterNode* node) {
void EffectGraphVisitor::VisitInstanceSetterNode(InstanceSetterNode* node) {
- // We preallocate a temporary to overlap with the value of the assignment.
- const Smi& zero = Smi::ZoneHandle(Smi::New(0));
- AddInstruction(new BindInstr(temp_index(), new ConstantVal(zero)));
- TempVal* placeholder = new TempVal(temp_index());
- ArgumentGraphVisitor for_receiver(owner(), temp_index() + 1);
+ ArgumentGraphVisitor for_receiver(owner(), temp_index());
node->receiver()->Visit(&for_receiver);
Append(for_receiver);
ArgumentGraphVisitor for_value(owner(), for_receiver.temp_index());
node->value()->Visit(&for_value);
Append(for_value);
InstanceSetterComp* setter = new InstanceSetterComp(node,
- placeholder,
for_receiver.value(),
for_value.value());
ReturnComputation(setter);
@@ -587,17 +582,7 @@ void EffectGraphVisitor::VisitLoadIndexedNode(LoadIndexedNode* node) {
void EffectGraphVisitor::VisitStoreIndexedNode(StoreIndexedNode* node) {
- // This is not a straight instance call to e0.[]=(e1, e2), it is a
- // call to
- //
- // (a, i, v) { a.[]=(i, v); return v; }(e0, e1, e2)
- //
- // Without constructing that function, we simulate it at the IL
- // level by preallocating a slot for the return value.
- const Smi& zero = Smi::ZoneHandle(Smi::New(0));
- AddInstruction(new BindInstr(temp_index(), new ConstantVal(zero)));
- TempVal* placeholder = new TempVal(temp_index());
- ArgumentGraphVisitor for_array(owner(), temp_index() + 1);
+ ArgumentGraphVisitor for_array(owner(), temp_index());
node->array()->Visit(&for_array);
Append(for_array);
ArgumentGraphVisitor for_index(owner(), for_array.temp_index());
@@ -607,7 +592,6 @@ void EffectGraphVisitor::VisitStoreIndexedNode(StoreIndexedNode* node) {
node->value()->Visit(&for_value);
Append(for_value);
StoreIndexedComp* store = new StoreIndexedComp(node,
- placeholder,
for_array.value(),
for_index.value(),
for_value.value());
@@ -774,8 +758,6 @@ void FlowGraphPrinter::VisitNativeCall(NativeCallComp* comp) {
void FlowGraphPrinter::VisitStoreIndexed(StoreIndexedComp* comp) {
OS::Print("StoreIndexed(");
- comp->placeholder()->Accept(this);
- OS::Print(", ");
comp->array()->Accept(this);
OS::Print(", ");
comp->index()->Accept(this);
@@ -787,8 +769,6 @@ void FlowGraphPrinter::VisitStoreIndexed(StoreIndexedComp* comp) {
void FlowGraphPrinter::VisitInstanceSetter(InstanceSetterComp* comp) {
OS::Print("InstanceSetter(");
- comp->placeholder()->Accept(this);
- OS::Print(", ");
comp->receiver()->Accept(this);
OS::Print(", ");
comp->value()->Accept(this);
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698