| 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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 __ LoadObject(dst, value->AsConstant()->value()); | 464 __ LoadObject(dst, value->AsConstant()->value()); |
| 465 } | 465 } |
| 466 } else { | 466 } else { |
| 467 ASSERT(value->IsUse()); | 467 ASSERT(value->IsUse()); |
| 468 __ popq(dst); | 468 __ popq(dst); |
| 469 } | 469 } |
| 470 } | 470 } |
| 471 | 471 |
| 472 | 472 |
| 473 void FlowGraphCompiler::VisitUse(UseVal* val) { | 473 void FlowGraphCompiler::VisitUse(UseVal* val) { |
| 474 LoadValue(RAX, val); | 474 // UseVal is never visited during code generation. |
| 475 UNREACHABLE(); |
| 475 } | 476 } |
| 476 | 477 |
| 477 | 478 |
| 478 void FlowGraphCompiler::VisitConstant(ConstantVal* val) { | 479 void FlowGraphCompiler::VisitConstant(ConstantVal* val) { |
| 479 LoadValue(RAX, val); | 480 // Moved to intermediate_language_x64.cc. |
| 481 UNREACHABLE(); |
| 480 } | 482 } |
| 481 | 483 |
| 482 | 484 |
| 483 void FlowGraphCompiler::VisitAssertAssignable(AssertAssignableComp* comp) { | 485 void FlowGraphCompiler::VisitAssertAssignable(AssertAssignableComp* comp) { |
| 484 const Immediate raw_null = | 486 const Immediate raw_null = |
| 485 Immediate(reinterpret_cast<intptr_t>(Object::null())); | 487 Immediate(reinterpret_cast<intptr_t>(Object::null())); |
| 486 if (comp->instantiator_type_arguments() == NULL) { | 488 if (comp->instantiator_type_arguments() == NULL) { |
| 487 __ movq(RDX, raw_null); | 489 __ movq(RDX, raw_null); |
| 488 } else { | 490 } else { |
| 489 LoadValue(RDX, comp->instantiator_type_arguments()); | 491 LoadValue(RDX, comp->instantiator_type_arguments()); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 } | 658 } |
| 657 | 659 |
| 658 | 660 |
| 659 void FlowGraphCompiler::VisitStaticCall(StaticCallComp* comp) { | 661 void FlowGraphCompiler::VisitStaticCall(StaticCallComp* comp) { |
| 660 // Moved to intermediate_language_x64.cc. | 662 // Moved to intermediate_language_x64.cc. |
| 661 UNREACHABLE(); | 663 UNREACHABLE(); |
| 662 } | 664 } |
| 663 | 665 |
| 664 | 666 |
| 665 void FlowGraphCompiler::VisitLoadLocal(LoadLocalComp* comp) { | 667 void FlowGraphCompiler::VisitLoadLocal(LoadLocalComp* comp) { |
| 666 __ movq(RAX, Address(RBP, comp->local().index() * kWordSize)); | 668 // Moved to intermediate_language_x64.cc. |
| 669 UNREACHABLE(); |
| 667 } | 670 } |
| 668 | 671 |
| 669 | 672 |
| 670 void FlowGraphCompiler::VisitStoreLocal(StoreLocalComp* comp) { | 673 void FlowGraphCompiler::VisitStoreLocal(StoreLocalComp* comp) { |
| 671 LoadValue(RAX, comp->value()); | 674 // Moved to intermediate_language_x64.cc. |
| 672 __ movq(Address(RBP, comp->local().index() * kWordSize), RAX); | 675 UNREACHABLE(); |
| 673 } | 676 } |
| 674 | 677 |
| 675 | 678 |
| 676 void FlowGraphCompiler::VisitNativeCall(NativeCallComp* comp) { | 679 void FlowGraphCompiler::VisitNativeCall(NativeCallComp* comp) { |
| 677 // Push the result place holder initialized to NULL. | 680 // Push the result place holder initialized to NULL. |
| 678 __ PushObject(Object::ZoneHandle()); | 681 __ PushObject(Object::ZoneHandle()); |
| 679 // Pass a pointer to the first argument in RAX. | 682 // Pass a pointer to the first argument in RAX. |
| 680 if (!comp->has_optional_parameters()) { | 683 if (!comp->has_optional_parameters()) { |
| 681 __ leaq(RAX, Address(RBP, (1 + comp->argument_count()) * kWordSize)); | 684 __ leaq(RAX, Address(RBP, (1 + comp->argument_count()) * kWordSize)); |
| 682 } else { | 685 } else { |
| (...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1799 | 1802 |
| 1800 | 1803 |
| 1801 void FlowGraphCompiler::FinalizeComments(const Code& code) { | 1804 void FlowGraphCompiler::FinalizeComments(const Code& code) { |
| 1802 code.set_comments(assembler_->GetCodeComments()); | 1805 code.set_comments(assembler_->GetCodeComments()); |
| 1803 } | 1806 } |
| 1804 | 1807 |
| 1805 | 1808 |
| 1806 } // namespace dart | 1809 } // namespace dart |
| 1807 | 1810 |
| 1808 #endif // defined TARGET_ARCH_X64 | 1811 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |