| 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 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 } | 740 } |
| 741 | 741 |
| 742 | 742 |
| 743 void FlowGraphCompiler::VisitInstanceCall(InstanceCallComp* comp) { | 743 void FlowGraphCompiler::VisitInstanceCall(InstanceCallComp* comp) { |
| 744 // Moved to intermediate_language_x64.cc. | 744 // Moved to intermediate_language_x64.cc. |
| 745 UNREACHABLE(); | 745 UNREACHABLE(); |
| 746 } | 746 } |
| 747 | 747 |
| 748 | 748 |
| 749 void FlowGraphCompiler::VisitStrictCompare(StrictCompareComp* comp) { | 749 void FlowGraphCompiler::VisitStrictCompare(StrictCompareComp* comp) { |
| 750 // Visitor should not be used to compile this instruction. | 750 // Moved to intermediate_language_x64.cc. |
| 751 // Native code template for StrictCompareComp was moved to | |
| 752 // StrictCompareComp::EmitNativeCode. | |
| 753 UNREACHABLE(); | 751 UNREACHABLE(); |
| 754 } | 752 } |
| 755 | 753 |
| 756 | 754 |
| 757 void FlowGraphCompiler::VisitEqualityCompare(EqualityCompareComp* comp) { | 755 void FlowGraphCompiler::VisitEqualityCompare(EqualityCompareComp* comp) { |
| 758 // Moved to intermediate_language_x64.cc. | 756 // Moved to intermediate_language_x64.cc. |
| 759 UNREACHABLE(); | 757 UNREACHABLE(); |
| 760 } | 758 } |
| 761 | 759 |
| 762 | 760 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 } | 801 } |
| 804 | 802 |
| 805 | 803 |
| 806 void FlowGraphCompiler::VisitStoreStaticField(StoreStaticFieldComp* comp) { | 804 void FlowGraphCompiler::VisitStoreStaticField(StoreStaticFieldComp* comp) { |
| 807 // Moved to intermediate_language_x64.cc. | 805 // Moved to intermediate_language_x64.cc. |
| 808 UNREACHABLE(); | 806 UNREACHABLE(); |
| 809 } | 807 } |
| 810 | 808 |
| 811 | 809 |
| 812 void FlowGraphCompiler::VisitStoreIndexed(StoreIndexedComp* comp) { | 810 void FlowGraphCompiler::VisitStoreIndexed(StoreIndexedComp* comp) { |
| 813 // Call operator []= but preserve the third argument value under the | 811 // Moved to intermediate_language_x64.cc. |
| 814 // arguments as the result of the computation. | 812 UNREACHABLE(); |
| 815 const String& function_name = | |
| 816 String::ZoneHandle(String::NewSymbol(Token::Str(Token::kASSIGN_INDEX))); | |
| 817 | |
| 818 // Insert a copy of the third (last) argument under the arguments. | |
| 819 __ popq(RAX); // Value. | |
| 820 __ popq(RBX); // Index. | |
| 821 __ popq(RCX); // Receiver. | |
| 822 __ pushq(RAX); | |
| 823 __ pushq(RCX); | |
| 824 __ pushq(RBX); | |
| 825 __ pushq(RAX); | |
| 826 EmitInstanceCall(comp->cid(), | |
| 827 comp->token_index(), | |
| 828 comp->try_index(), | |
| 829 function_name, | |
| 830 3, | |
| 831 Array::ZoneHandle(), | |
| 832 1); | |
| 833 __ popq(RAX); | |
| 834 } | 813 } |
| 835 | 814 |
| 836 | 815 |
| 837 void FlowGraphCompiler::VisitInstanceSetter(InstanceSetterComp* comp) { | 816 void FlowGraphCompiler::VisitInstanceSetter(InstanceSetterComp* comp) { |
| 838 // Preserve the second argument under the arguments as the result of the | 817 // Moved to intermediate_language_x64.cc. |
| 839 // computation, then call the setter. | 818 UNREACHABLE(); |
| 840 const String& function_name = | |
| 841 String::ZoneHandle(Field::SetterSymbol(comp->field_name())); | |
| 842 | |
| 843 // Insert a copy of the second (last) argument under the arguments. | |
| 844 __ popq(RAX); // Value. | |
| 845 __ popq(RBX); // Receiver. | |
| 846 __ pushq(RAX); | |
| 847 __ pushq(RBX); | |
| 848 __ pushq(RAX); | |
| 849 EmitInstanceCall(comp->cid(), | |
| 850 comp->token_index(), | |
| 851 comp->try_index(), | |
| 852 function_name, | |
| 853 2, | |
| 854 Array::ZoneHandle(), | |
| 855 1); | |
| 856 __ popq(RAX); | |
| 857 } | 819 } |
| 858 | 820 |
| 859 | 821 |
| 860 void FlowGraphCompiler::VisitStaticSetter(StaticSetterComp* comp) { | 822 void FlowGraphCompiler::VisitStaticSetter(StaticSetterComp* comp) { |
| 861 // Preserve the argument as the result of the computation, | 823 // Moved to intermediate_language_x64.cc. |
| 862 // then call the setter. | 824 UNREACHABLE(); |
| 863 | |
| 864 // Duplicate the argument. | |
| 865 __ movq(RAX, Address(RSP, 0)); | |
| 866 __ pushq(RAX); | |
| 867 EmitStaticCall(comp->token_index(), | |
| 868 comp->try_index(), | |
| 869 comp->setter_function(), | |
| 870 1, | |
| 871 Array::ZoneHandle()); | |
| 872 __ popq(RAX); | |
| 873 } | 825 } |
| 874 | 826 |
| 875 | 827 |
| 876 void FlowGraphCompiler::VisitBooleanNegate(BooleanNegateComp* comp) { | 828 void FlowGraphCompiler::VisitBooleanNegate(BooleanNegateComp* comp) { |
| 877 // Moved to intermediate_language_x64.cc. | 829 // Moved to intermediate_language_x64.cc. |
| 878 UNREACHABLE(); | 830 UNREACHABLE(); |
| 879 } | 831 } |
| 880 | 832 |
| 881 | 833 |
| 882 // Optimize instanceof type test by adding inlined tests for: | 834 // Optimize instanceof type test by adding inlined tests for: |
| (...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1770 | 1722 |
| 1771 void FlowGraphCompiler::FinalizeComments(const Code& code) { | 1723 void FlowGraphCompiler::FinalizeComments(const Code& code) { |
| 1772 code.set_comments(assembler_->GetCodeComments()); | 1724 code.set_comments(assembler_->GetCodeComments()); |
| 1773 } | 1725 } |
| 1774 | 1726 |
| 1775 #undef __ | 1727 #undef __ |
| 1776 | 1728 |
| 1777 } // namespace dart | 1729 } // namespace dart |
| 1778 | 1730 |
| 1779 #endif // defined TARGET_ARCH_X64 | 1731 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |