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

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

Issue 9961019: Implement context cloning in new compiler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/intermediate_language.h » ('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_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
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).
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
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
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698