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

Side by Side Diff: vm/flow_graph_compiler.cc

Issue 10700034: Add a goto instruction to the IL use it to terminate basic blocks. (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « vm/flow_graph_builder.cc ('k') | vm/il_printer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/globals.h" // Needed here to get TARGET_ARCH_XXX. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX.
6 6
7 #include "vm/flow_graph_compiler.h" 7 #include "vm/flow_graph_compiler.h"
8 8
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/debugger.h" 10 #include "vm/debugger.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 for (intptr_t i = 0; i < block_order().length(); ++i) { 92 for (intptr_t i = 0; i < block_order().length(); ++i) {
93 ASSERT(frame_register_allocator()->IsSpilled()); 93 ASSERT(frame_register_allocator()->IsSpilled());
94 assembler()->Comment("B%d", i); 94 assembler()->Comment("B%d", i);
95 // Compile the block entry. 95 // Compile the block entry.
96 set_current_block(block_order()[i]); 96 set_current_block(block_order()[i]);
97 current_block()->PrepareEntry(this); 97 current_block()->PrepareEntry(this);
98 Instruction* instr = current_block()->StraightLineSuccessor(); 98 Instruction* instr = current_block()->StraightLineSuccessor();
99 // Compile all successors until an exit, branch, or a block entry. 99 // Compile all successors until an exit, branch, or a block entry.
100 while ((instr != NULL) && !instr->IsBlockEntry()) { 100 while ((instr != NULL) && !instr->IsBlockEntry()) {
101 if (FLAG_code_comments) EmitComment(instr); 101 if (FLAG_code_comments) EmitComment(instr);
102 ASSERT(instr->locs() != NULL); 102 ASSERT(instr->IsGoto() || instr->locs() != NULL);
103 EmitInstructionPrologue(instr); 103 if (instr->locs() != NULL) {
104 instr->EmitNativeCode(this); 104 EmitInstructionPrologue(instr);
105 instr->EmitNativeCode(this);
106 }
105 instr = instr->StraightLineSuccessor(); 107 instr = instr->StraightLineSuccessor();
106 } 108 }
107 BlockEntryInstr* successor = 109 BlockEntryInstr* successor =
108 (instr == NULL) ? NULL : instr->AsBlockEntry(); 110 (instr == NULL) ? NULL : instr->AsBlockEntry();
109 if (successor != NULL) { 111 if (successor != NULL) {
110 frame_register_allocator()->Spill(); 112 frame_register_allocator()->Spill();
111 // Block ended with a "goto". We can fall through if it is the 113 // Block ended with a "goto". We can fall through if it is the
112 // next block in the list. Otherwise, we need a jump. 114 // next block in the list. Otherwise, we need a jump.
113 if ((i == block_order().length() - 1) || 115 if ((i == block_order().length() - 1) ||
114 (block_order()[i + 1] != successor)) { 116 (block_order()[i + 1] != successor)) {
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 624
623 625
624 void FrameRegisterAllocator::SpillInDeoptStub(DeoptimizationStub* stub) { 626 void FrameRegisterAllocator::SpillInDeoptStub(DeoptimizationStub* stub) {
625 for (int i = 0; i < stack_.length(); i++) { 627 for (int i = 0; i < stack_.length(); i++) {
626 stub->Push(stack_[i]); 628 stub->Push(stack_[i]);
627 } 629 }
628 } 630 }
629 631
630 632
631 } // namespace dart 633 } // namespace dart
OLDNEW
« no previous file with comments | « vm/flow_graph_builder.cc ('k') | vm/il_printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698