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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 10350003: Step toward eliminating increment nodes, starting with increment local. Fix a bug in evaluating sid… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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.h ('k') | runtime/vm/opt_code_generator_ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
===================================================================
--- runtime/vm/flow_graph_builder.cc (revision 7298)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -724,54 +724,6 @@
}
-void EffectGraphVisitor::VisitIncrOpLocalNode(IncrOpLocalNode* node) {
- ASSERT((node->kind() == Token::kINCR) || (node->kind() == Token::kDECR));
- // In an effect context, treat postincrement as if it were preincrement
- // because its value is not needed.
-
- // 1. Load the value.
- BindInstr* load =
- new BindInstr(new LoadLocalComp(node->local(), owner()->context_level()));
- AddInstruction(load);
- // 2. Increment.
- Definition* incr =
- BuildIncrOpIncrement(node->kind(), node->token_index(), new UseVal(load));
- // 3. Perform the store, resulting in the new value.
- StoreLocalComp* store = new StoreLocalComp(
- node->local(), new UseVal(incr), owner()->context_level());
- ReturnComputation(store);
-}
-
-
-void ValueGraphVisitor::VisitIncrOpLocalNode(IncrOpLocalNode* node) {
- ASSERT((node->kind() == Token::kINCR) || (node->kind() == Token::kDECR));
- if (node->prefix()) {
- // Base class handles preincrement.
- EffectGraphVisitor::VisitIncrOpLocalNode(node);
- return;
- }
- // For postincrement, duplicate the original value to use one copy as the
- // result.
- //
- // 1. Load the value.
- BindInstr* load =
- new BindInstr(new LoadLocalComp(node->local(), owner()->context_level()));
- AddInstruction(load);
- // 2. Duplicate it to increment.
- PickTempInstr* duplicate = new PickTempInstr(load->temp_index());
- AddInstruction(duplicate);
- // 3. Increment.
- Definition* incr =
- BuildIncrOpIncrement(node->kind(), node->token_index(),
- new UseVal(duplicate));
- // 4. Perform the store and return the original value.
- StoreLocalComp* store = new StoreLocalComp(
- node->local(), new UseVal(incr), owner()->context_level());
- AddInstruction(new DoInstr(store));
- ReturnValue(new UseVal(load));
-}
-
-
Definition* EffectGraphVisitor::BuildIncrOpFieldLoad(
IncrOpInstanceFieldNode* node,
Value** receiver) {
« no previous file with comments | « runtime/vm/flow_graph_builder.h ('k') | runtime/vm/opt_code_generator_ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698