OLD | NEW |
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 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1183 | 1183 |
1184 void FlowGraphCompiler::VisitTargetEntry(TargetEntryInstr* instr) { | 1184 void FlowGraphCompiler::VisitTargetEntry(TargetEntryInstr* instr) { |
1185 __ Bind(&block_info_[instr->postorder_number()]->label); | 1185 __ Bind(&block_info_[instr->postorder_number()]->label); |
1186 if (instr->HasTryIndex()) { | 1186 if (instr->HasTryIndex()) { |
1187 exception_handlers_list_->AddHandler(instr->try_index(), | 1187 exception_handlers_list_->AddHandler(instr->try_index(), |
1188 assembler_->CodeSize()); | 1188 assembler_->CodeSize()); |
1189 } | 1189 } |
1190 } | 1190 } |
1191 | 1191 |
1192 | 1192 |
1193 void FlowGraphCompiler::VisitPickTemp(PickTempInstr* instr) { | |
1194 // Semantics is to copy a stack-allocated temporary to the top of stack. | |
1195 // Destination index d is assumed the new top of stack after the | |
1196 // operation, so d-1 is the current top of stack and so d-s-1 is the | |
1197 // offset to source index s. | |
1198 intptr_t offset = instr->temp_index() - instr->source() - 1; | |
1199 ASSERT(offset >= 0); | |
1200 __ pushq(Address(RSP, offset * kWordSize)); | |
1201 } | |
1202 | |
1203 | |
1204 void FlowGraphCompiler::VisitTuckTemp(TuckTempInstr* instr) { | |
1205 // Semantics is to assign to a stack-allocated temporary a copy of the top | |
1206 // of stack. Source index s is assumed the top of stack, s-d is the | |
1207 // offset to destination index d. | |
1208 intptr_t offset = instr->source() - instr->destination(); | |
1209 ASSERT(offset >= 0); | |
1210 __ movq(RAX, Address(RSP, 0)); | |
1211 __ movq(Address(RSP, offset * kWordSize), RAX); | |
1212 } | |
1213 | |
1214 | |
1215 void FlowGraphCompiler::VisitDo(DoInstr* instr) { | 1193 void FlowGraphCompiler::VisitDo(DoInstr* instr) { |
1216 instr->computation()->Accept(this); | 1194 instr->computation()->Accept(this); |
1217 } | 1195 } |
1218 | 1196 |
1219 | 1197 |
1220 void FlowGraphCompiler::VisitBind(BindInstr* instr) { | 1198 void FlowGraphCompiler::VisitBind(BindInstr* instr) { |
1221 instr->computation()->Accept(this); | 1199 instr->computation()->Accept(this); |
1222 __ pushq(RAX); | 1200 __ pushq(RAX); |
1223 } | 1201 } |
1224 | 1202 |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1733 ASSERT(exception_handlers_list_ != NULL); | 1711 ASSERT(exception_handlers_list_ != NULL); |
1734 const ExceptionHandlers& handlers = ExceptionHandlers::Handle( | 1712 const ExceptionHandlers& handlers = ExceptionHandlers::Handle( |
1735 exception_handlers_list_->FinalizeExceptionHandlers(code.EntryPoint())); | 1713 exception_handlers_list_->FinalizeExceptionHandlers(code.EntryPoint())); |
1736 code.set_exception_handlers(handlers); | 1714 code.set_exception_handlers(handlers); |
1737 } | 1715 } |
1738 | 1716 |
1739 | 1717 |
1740 } // namespace dart | 1718 } // namespace dart |
1741 | 1719 |
1742 #endif // defined TARGET_ARCH_X64 | 1720 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |