| 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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 __ LoadObject(dst, value->AsConstant()->value()); | 374 __ LoadObject(dst, value->AsConstant()->value()); |
| 375 } | 375 } |
| 376 } else { | 376 } else { |
| 377 ASSERT(value->IsUse()); | 377 ASSERT(value->IsUse()); |
| 378 __ popq(dst); | 378 __ popq(dst); |
| 379 } | 379 } |
| 380 } | 380 } |
| 381 | 381 |
| 382 | 382 |
| 383 void FlowGraphCompiler::VisitUse(UseVal* val) { | 383 void FlowGraphCompiler::VisitUse(UseVal* val) { |
| 384 LoadValue(RAX, val); | 384 // UseVal is never visited during code generation. |
| 385 UNREACHABLE(); |
| 385 } | 386 } |
| 386 | 387 |
| 387 | 388 |
| 388 void FlowGraphCompiler::VisitConstant(ConstantVal* val) { | 389 void FlowGraphCompiler::VisitConstant(ConstantVal* val) { |
| 389 LoadValue(RAX, val); | 390 // Moved to intermediate_language_x64.cc. |
| 391 UNREACHABLE(); |
| 390 } | 392 } |
| 391 | 393 |
| 392 | 394 |
| 393 void FlowGraphCompiler::VisitAssertAssignable(AssertAssignableComp* comp) { | 395 void FlowGraphCompiler::VisitAssertAssignable(AssertAssignableComp* comp) { |
| 394 const Immediate raw_null = | 396 const Immediate raw_null = |
| 395 Immediate(reinterpret_cast<intptr_t>(Object::null())); | 397 Immediate(reinterpret_cast<intptr_t>(Object::null())); |
| 396 if (comp->instantiator_type_arguments() == NULL) { | 398 if (comp->instantiator_type_arguments() == NULL) { |
| 397 __ movq(RDX, raw_null); | 399 __ movq(RDX, raw_null); |
| 398 } else { | 400 } else { |
| 399 LoadValue(RDX, comp->instantiator_type_arguments()); | 401 LoadValue(RDX, comp->instantiator_type_arguments()); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 } | 568 } |
| 567 | 569 |
| 568 | 570 |
| 569 void FlowGraphCompiler::VisitStaticCall(StaticCallComp* comp) { | 571 void FlowGraphCompiler::VisitStaticCall(StaticCallComp* comp) { |
| 570 // Moved to intermediate_language_x64.cc. | 572 // Moved to intermediate_language_x64.cc. |
| 571 UNREACHABLE(); | 573 UNREACHABLE(); |
| 572 } | 574 } |
| 573 | 575 |
| 574 | 576 |
| 575 void FlowGraphCompiler::VisitLoadLocal(LoadLocalComp* comp) { | 577 void FlowGraphCompiler::VisitLoadLocal(LoadLocalComp* comp) { |
| 576 __ movq(RAX, Address(RBP, comp->local().index() * kWordSize)); | 578 // Moved to intermediate_language_x64.cc. |
| 579 UNREACHABLE(); |
| 577 } | 580 } |
| 578 | 581 |
| 579 | 582 |
| 580 void FlowGraphCompiler::VisitStoreLocal(StoreLocalComp* comp) { | 583 void FlowGraphCompiler::VisitStoreLocal(StoreLocalComp* comp) { |
| 581 LoadValue(RAX, comp->value()); | 584 // Moved to intermediate_language_x64.cc. |
| 582 __ movq(Address(RBP, comp->local().index() * kWordSize), RAX); | 585 UNREACHABLE(); |
| 583 } | 586 } |
| 584 | 587 |
| 585 | 588 |
| 586 void FlowGraphCompiler::VisitNativeCall(NativeCallComp* comp) { | 589 void FlowGraphCompiler::VisitNativeCall(NativeCallComp* comp) { |
| 587 // Push the result place holder initialized to NULL. | 590 // Push the result place holder initialized to NULL. |
| 588 __ PushObject(Object::ZoneHandle()); | 591 __ PushObject(Object::ZoneHandle()); |
| 589 // Pass a pointer to the first argument in RAX. | 592 // Pass a pointer to the first argument in RAX. |
| 590 if (!comp->has_optional_parameters()) { | 593 if (!comp->has_optional_parameters()) { |
| 591 __ leaq(RAX, Address(RBP, (1 + comp->argument_count()) * kWordSize)); | 594 __ leaq(RAX, Address(RBP, (1 + comp->argument_count()) * kWordSize)); |
| 592 } else { | 595 } else { |
| (...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1708 | 1711 |
| 1709 | 1712 |
| 1710 void FlowGraphCompiler::FinalizeComments(const Code& code) { | 1713 void FlowGraphCompiler::FinalizeComments(const Code& code) { |
| 1711 code.set_comments(assembler_->GetCodeComments()); | 1714 code.set_comments(assembler_->GetCodeComments()); |
| 1712 } | 1715 } |
| 1713 | 1716 |
| 1714 | 1717 |
| 1715 } // namespace dart | 1718 } // namespace dart |
| 1716 | 1719 |
| 1717 #endif // defined TARGET_ARCH_X64 | 1720 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |