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

Side by Side Diff: vm/flow_graph_compiler_x64.cc

Issue 10443013: Add support for temp locations and port Load-/StoreStaticField to use locations. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: 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
« no previous file with comments | « no previous file | vm/intermediate_language_x64.cc » ('j') | vm/locations.cc » ('J')
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 "lib/error.h" 10 #include "lib/error.h"
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after
882 void FlowGraphCompiler::VisitStoreInstanceField(StoreInstanceFieldComp* comp) { 882 void FlowGraphCompiler::VisitStoreInstanceField(StoreInstanceFieldComp* comp) {
883 ASSERT(VerifyValues(comp->instance(), comp->value())); 883 ASSERT(VerifyValues(comp->instance(), comp->value()));
884 LoadValue(RDX, comp->value()); 884 LoadValue(RDX, comp->value());
885 LoadValue(RAX, comp->instance()); 885 LoadValue(RAX, comp->instance());
886 __ StoreIntoObject(RAX, FieldAddress(RAX, comp->field().Offset()), RDX); 886 __ StoreIntoObject(RAX, FieldAddress(RAX, comp->field().Offset()), RDX);
887 } 887 }
888 888
889 889
890 890
891 void FlowGraphCompiler::VisitLoadStaticField(LoadStaticFieldComp* comp) { 891 void FlowGraphCompiler::VisitLoadStaticField(LoadStaticFieldComp* comp) {
892 __ LoadObject(RDX, comp->field()); 892 // Moved to intermediate_language_x64.cc.
893 __ movq(RAX, FieldAddress(RDX, Field::value_offset())); 893 UNREACHABLE();
894 } 894 }
895 895
896 896
897 void FlowGraphCompiler::VisitStoreStaticField(StoreStaticFieldComp* comp) { 897 void FlowGraphCompiler::VisitStoreStaticField(StoreStaticFieldComp* comp) {
898 LoadValue(RAX, comp->value()); 898 // Moved to intermediate_language_x64.cc.
899 __ LoadObject(RDX, comp->field()); 899 UNREACHABLE();
900 __ StoreIntoObject(RDX, FieldAddress(RDX, Field::value_offset()), RAX);
901 } 900 }
902 901
903 902
904 void FlowGraphCompiler::VisitStoreIndexed(StoreIndexedComp* comp) { 903 void FlowGraphCompiler::VisitStoreIndexed(StoreIndexedComp* comp) {
905 // Call operator []= but preserve the third argument value under the 904 // Call operator []= but preserve the third argument value under the
906 // arguments as the result of the computation. 905 // arguments as the result of the computation.
907 const String& function_name = 906 const String& function_name =
908 String::ZoneHandle(String::NewSymbol(Token::Str(Token::kASSIGN_INDEX))); 907 String::ZoneHandle(String::NewSymbol(Token::Str(Token::kASSIGN_INDEX)));
909 908
910 // Insert a copy of the third (last) argument under the arguments. 909 // Insert a copy of the third (last) argument under the arguments.
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
1349 } 1348 }
1350 1349
1351 1350
1352 void FlowGraphCompiler::EmitInstructionPrologue(Instruction* instr) { 1351 void FlowGraphCompiler::EmitInstructionPrologue(Instruction* instr) {
1353 LocationSummary* locs = instr->locs(); 1352 LocationSummary* locs = instr->locs();
1354 ASSERT(locs != NULL); 1353 ASSERT(locs != NULL);
1355 1354
1356 locs->AllocateRegisters(); 1355 locs->AllocateRegisters();
1357 1356
1358 // Load instruction inputs into allocated registers. 1357 // Load instruction inputs into allocated registers.
1359 for (intptr_t i = locs->count() - 1; i >= 0; i--) { 1358 for (intptr_t i = locs->input_count() - 1; i >= 0; i--) {
1360 Location loc = locs->in(i); 1359 Location loc = locs->in(i);
1361 ASSERT(loc.kind() == Location::kRegister); 1360 ASSERT(loc.kind() == Location::kRegister);
1362 __ popq(loc.reg()); 1361 __ popq(loc.reg());
1363 } 1362 }
1364 } 1363 }
1365 1364
1366 1365
1367 void FlowGraphCompiler::VisitBlocks() { 1366 void FlowGraphCompiler::VisitBlocks() {
1368 for (intptr_t i = 0; i < block_order_.length(); ++i) { 1367 for (intptr_t i = 0; i < block_order_.length(); ++i) {
1369 __ Comment("B%d", i); 1368 __ Comment("B%d", i);
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
1987 1986
1988 void FlowGraphCompiler::FinalizeComments(const Code& code) { 1987 void FlowGraphCompiler::FinalizeComments(const Code& code) {
1989 code.set_comments(assembler_->GetCodeComments()); 1988 code.set_comments(assembler_->GetCodeComments());
1990 } 1989 }
1991 1990
1992 #undef __ 1991 #undef __
1993 1992
1994 } // namespace dart 1993 } // namespace dart
1995 1994
1996 #endif // defined TARGET_ARCH_X64 1995 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « no previous file | vm/intermediate_language_x64.cc » ('j') | vm/locations.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698