Chromium Code Reviews| 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 "vm/ast_printer.h" | 10 #include "vm/ast_printer.h" |
| (...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 806 __ popq(RAX); | 806 __ popq(RAX); |
| 807 // Chain the new context in RAX to its parent in CTX. | 807 // Chain the new context in RAX to its parent in CTX. |
| 808 __ StoreIntoObject(RAX, | 808 __ StoreIntoObject(RAX, |
| 809 FieldAddress(RAX, Context::parent_offset()), | 809 FieldAddress(RAX, Context::parent_offset()), |
| 810 CTX); | 810 CTX); |
| 811 // Set new context as current context. | 811 // Set new context as current context. |
| 812 __ movq(CTX, RAX); | 812 __ movq(CTX, RAX); |
| 813 } | 813 } |
| 814 | 814 |
| 815 | 815 |
| 816 void FlowGraphCompiler::VisitCloneContext(CloneContextComp* comp) { | |
| 817 __ popq(RAX); // Get context value from stack. | |
| 818 __ PushObject(Object::ZoneHandle()); // Make room for the result. | |
| 819 __ pushq(RAX); | |
| 820 GenerateCallRuntime(comp->node_id(), | |
| 821 comp->token_index(), | |
| 822 kCloneContextRuntimeEntry); | |
| 823 __ popq(RAX); // Remove argument. | |
| 824 __ popq(RAX); // Get result (cloned context).nn | |
|
regis
2012/04/04 22:37:19
.nn?
srdjan
2012/04/04 23:10:23
An I wondered why the review did not jump to next
| |
| 825 } | |
| 826 | |
| 827 | |
| 816 void FlowGraphCompiler::VisitBlocks() { | 828 void FlowGraphCompiler::VisitBlocks() { |
| 817 for (intptr_t i = 0; i < block_order_.length(); ++i) { | 829 for (intptr_t i = 0; i < block_order_.length(); ++i) { |
| 818 // Compile the block entry. | 830 // Compile the block entry. |
| 819 current_block_ = block_order_[i]; | 831 current_block_ = block_order_[i]; |
| 820 Instruction* instr = current_block()->Accept(this); | 832 Instruction* instr = current_block()->Accept(this); |
| 821 // Compile all successors until an exit, branch, or a block entry. | 833 // Compile all successors until an exit, branch, or a block entry. |
| 822 while ((instr != NULL) && !instr->IsBlockEntry()) { | 834 while ((instr != NULL) && !instr->IsBlockEntry()) { |
| 823 instr = instr->Accept(this); | 835 instr = instr->Accept(this); |
| 824 } | 836 } |
| 825 | 837 |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1280 void FlowGraphCompiler::FinalizeExceptionHandlers(const Code& code) { | 1292 void FlowGraphCompiler::FinalizeExceptionHandlers(const Code& code) { |
| 1281 // We don't compile exception handlers yet. | 1293 // We don't compile exception handlers yet. |
| 1282 code.set_exception_handlers( | 1294 code.set_exception_handlers( |
| 1283 ExceptionHandlers::Handle(ExceptionHandlers::New(0))); | 1295 ExceptionHandlers::Handle(ExceptionHandlers::New(0))); |
| 1284 } | 1296 } |
| 1285 | 1297 |
| 1286 | 1298 |
| 1287 } // namespace dart | 1299 } // namespace dart |
| 1288 | 1300 |
| 1289 #endif // defined TARGET_ARCH_X64 | 1301 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |