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

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

Issue 10407019: Extend assembler with ability to produce comments for the generated code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address Srdjan comments Created 8 years, 7 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/globals.h" // Needed here to get TARGET_ARCH_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/flow_graph_compiler.h" 8 #include "vm/flow_graph_compiler.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
(...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 ASSERT(!comp->stacktrace_var().is_captured()); 1115 ASSERT(!comp->stacktrace_var().is_captured());
1116 __ movq(Address(RBP, comp->exception_var().index() * kWordSize), 1116 __ movq(Address(RBP, comp->exception_var().index() * kWordSize),
1117 kExceptionObjectReg); 1117 kExceptionObjectReg);
1118 __ movq(Address(RBP, comp->stacktrace_var().index() * kWordSize), 1118 __ movq(Address(RBP, comp->stacktrace_var().index() * kWordSize),
1119 kStackTraceObjectReg); 1119 kStackTraceObjectReg);
1120 } 1120 }
1121 1121
1122 1122
1123 void FlowGraphCompiler::VisitBlocks() { 1123 void FlowGraphCompiler::VisitBlocks() {
1124 for (intptr_t i = 0; i < block_order_.length(); ++i) { 1124 for (intptr_t i = 0; i < block_order_.length(); ++i) {
1125 __ Comment("B%d", i);
1125 // Compile the block entry. 1126 // Compile the block entry.
1126 current_block_ = block_order_[i]; 1127 current_block_ = block_order_[i];
1127 Instruction* instr = current_block()->Accept(this); 1128 Instruction* instr = current_block()->Accept(this);
1128 // Compile all successors until an exit, branch, or a block entry. 1129 // Compile all successors until an exit, branch, or a block entry.
1129 while ((instr != NULL) && !instr->IsBlockEntry()) { 1130 while ((instr != NULL) && !instr->IsBlockEntry()) {
1131 __ Comment("@%d: instruction", instr->cid());
1130 instr = instr->Accept(this); 1132 instr = instr->Accept(this);
1131 } 1133 }
1132 1134
1133 BlockEntryInstr* successor = 1135 BlockEntryInstr* successor =
1134 (instr == NULL) ? NULL : instr->AsBlockEntry(); 1136 (instr == NULL) ? NULL : instr->AsBlockEntry();
1135 if (successor != NULL) { 1137 if (successor != NULL) {
1136 // Block ended with a "goto". We can fall through if it is the 1138 // Block ended with a "goto". We can fall through if it is the
1137 // next block in the list. Otherwise, we need a jump. 1139 // next block in the list. Otherwise, we need a jump.
1138 if ((i == block_order_.length() - 1) || 1140 if ((i == block_order_.length() - 1) ||
1139 (block_order_[i + 1] != successor)) { 1141 (block_order_[i + 1] != successor)) {
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
1694 1696
1695 1697
1696 void FlowGraphCompiler::FinalizeExceptionHandlers(const Code& code) { 1698 void FlowGraphCompiler::FinalizeExceptionHandlers(const Code& code) {
1697 ASSERT(exception_handlers_list_ != NULL); 1699 ASSERT(exception_handlers_list_ != NULL);
1698 const ExceptionHandlers& handlers = ExceptionHandlers::Handle( 1700 const ExceptionHandlers& handlers = ExceptionHandlers::Handle(
1699 exception_handlers_list_->FinalizeExceptionHandlers(code.EntryPoint())); 1701 exception_handlers_list_->FinalizeExceptionHandlers(code.EntryPoint()));
1700 code.set_exception_handlers(handlers); 1702 code.set_exception_handlers(handlers);
1701 } 1703 }
1702 1704
1703 1705
1706 void FlowGraphCompiler::FinalizeComments(const Code& code) {
1707 code.set_comments(assembler_->GetCodeComments());
1708 }
1709
1710
1704 } // namespace dart 1711 } // namespace dart
1705 1712
1706 #endif // defined TARGET_ARCH_X64 1713 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698