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

Side by Side Diff: runtime/vm/flow_graph_builder.cc

Issue 10825282: Put PushArgument into the environment instead of raw values. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/flow_graph_builder.h" 5 #include "vm/flow_graph_builder.h"
6 6
7 #include "vm/ast_printer.h" 7 #include "vm/ast_printer.h"
8 #include "vm/bit_vector.h" 8 #include "vm/bit_vector.h"
9 #include "vm/code_descriptors.h" 9 #include "vm/code_descriptors.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 entry_ = do_instr; 89 entry_ = do_instr;
90 } else { 90 } else {
91 exit()->set_next(do_instr); 91 exit()->set_next(do_instr);
92 } 92 }
93 exit_ = do_instr; 93 exit_ = do_instr;
94 } 94 }
95 95
96 96
97 void EffectGraphVisitor::AddInstruction(Instruction* instruction) { 97 void EffectGraphVisitor::AddInstruction(Instruction* instruction) {
98 ASSERT(is_open()); 98 ASSERT(is_open());
99 ASSERT(!instruction->IsDefinition()); 99 ASSERT(!instruction->IsBind());
100 ASSERT(!instruction->IsBlockEntry()); 100 ASSERT(!instruction->IsBlockEntry());
101 DeallocateTempIndex(instruction->InputCount()); 101 DeallocateTempIndex(instruction->InputCount());
102 if (is_empty()) { 102 if (is_empty()) {
103 entry_ = exit_ = instruction; 103 entry_ = exit_ = instruction;
104 } else { 104 } else {
105 exit()->set_next(instruction); 105 exit()->set_next(instruction);
106 exit_ = instruction; 106 exit_ = instruction;
107 } 107 }
108 } 108 }
109 109
(...skipping 2570 matching lines...) Expand 10 before | Expand all | Expand 10 after
2680 // Assign fresh SSA temporary and update expression stack. 2680 // Assign fresh SSA temporary and update expression stack.
2681 bind->set_ssa_temp_index(alloc_ssa_temp_index()); 2681 bind->set_ssa_temp_index(alloc_ssa_temp_index());
2682 env->Add(new UseVal(bind)); 2682 env->Add(new UseVal(bind));
2683 } 2683 }
2684 } 2684 }
2685 } 2685 }
2686 2686
2687 // 2c. Handle pushed argument. 2687 // 2c. Handle pushed argument.
2688 PushArgumentInstr* push = current->AsPushArgument(); 2688 PushArgumentInstr* push = current->AsPushArgument();
2689 if (push != NULL) { 2689 if (push != NULL) {
2690 env->Add(push->value()); 2690 env->Add(new UseVal(push));
2691 } 2691 }
2692 } 2692 }
2693 2693
2694 // 3. Process dominated blocks. 2694 // 3. Process dominated blocks.
2695 for (intptr_t i = 0; i < block_entry->dominated_blocks().length(); ++i) { 2695 for (intptr_t i = 0; i < block_entry->dominated_blocks().length(); ++i) {
2696 BlockEntryInstr* block = block_entry->dominated_blocks()[i]; 2696 BlockEntryInstr* block = block_entry->dominated_blocks()[i];
2697 GrowableArray<Value*> new_env(env->length()); 2697 GrowableArray<Value*> new_env(env->length());
2698 new_env.AddArray(*env); 2698 new_env.AddArray(*env);
2699 RenameRecursive(block, &new_env, live_phis); 2699 RenameRecursive(block, &new_env, live_phis);
2700 } 2700 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
2745 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; 2745 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1;
2746 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); 2746 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
2747 OS::SNPrint(chars, len, kFormat, function_name, reason); 2747 OS::SNPrint(chars, len, kFormat, function_name, reason);
2748 const Error& error = Error::Handle( 2748 const Error& error = Error::Handle(
2749 LanguageError::New(String::Handle(String::New(chars)))); 2749 LanguageError::New(String::Handle(String::New(chars))));
2750 Isolate::Current()->long_jump_base()->Jump(1, error); 2750 Isolate::Current()->long_jump_base()->Jump(1, error);
2751 } 2751 }
2752 2752
2753 2753
2754 } // namespace dart 2754 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698