| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 if (!function().HasOptionalParameters()) { | 805 if (!function().HasOptionalParameters()) { |
| 806 __ leaq(RAX, | 806 __ leaq(RAX, |
| 807 Address(RBP, (kParamEndSlotFromFp + function().NumParameters()) * | 807 Address(RBP, (kParamEndSlotFromFp + function().NumParameters()) * |
| 808 kWordSize)); | 808 kWordSize)); |
| 809 } else { | 809 } else { |
| 810 __ leaq(RAX, Address(RBP, kFirstLocalSlotFromFp * kWordSize)); | 810 __ leaq(RAX, Address(RBP, kFirstLocalSlotFromFp * kWordSize)); |
| 811 } | 811 } |
| 812 __ LoadImmediate(R10, Immediate(argc_tag)); | 812 __ LoadImmediate(R10, Immediate(argc_tag)); |
| 813 const StubEntry* stub_entry; | 813 const StubEntry* stub_entry; |
| 814 if (link_lazily()) { | 814 if (link_lazily()) { |
| 815 stub_entry = StubCode::CallBootstrapCFunction_entry(); | 815 stub_entry = StubCode::CallBootstrapNative_entry(); |
| 816 ExternalLabel label(NativeEntry::LinkNativeCallEntry()); | 816 ExternalLabel label(NativeEntry::LinkNativeCallEntry()); |
| 817 __ LoadNativeEntry(RBX, &label, kPatchable); | 817 __ LoadNativeEntry(RBX, &label, kPatchable); |
| 818 compiler->GeneratePatchableCall(token_pos(), *stub_entry, | 818 compiler->GeneratePatchableCall(token_pos(), *stub_entry, |
| 819 RawPcDescriptors::kOther, locs()); | 819 RawPcDescriptors::kOther, locs()); |
| 820 } else { | 820 } else { |
| 821 stub_entry = (is_bootstrap_native()) | 821 if (is_bootstrap_native()) { |
| 822 ? StubCode::CallBootstrapCFunction_entry() | 822 stub_entry = StubCode::CallBootstrapNative_entry(); |
| 823 : StubCode::CallNativeCFunction_entry(); | 823 } else if (is_auto_scope()) { |
| 824 stub_entry = StubCode::CallAutoScopeNative_entry(); |
| 825 } else { |
| 826 stub_entry = StubCode::CallNoScopeNative_entry(); |
| 827 } |
| 824 const ExternalLabel label(reinterpret_cast<uword>(native_c_function())); | 828 const ExternalLabel label(reinterpret_cast<uword>(native_c_function())); |
| 825 __ LoadNativeEntry(RBX, &label, kNotPatchable); | 829 __ LoadNativeEntry(RBX, &label, kNotPatchable); |
| 826 compiler->GenerateCall(token_pos(), *stub_entry, RawPcDescriptors::kOther, | 830 compiler->GenerateCall(token_pos(), *stub_entry, RawPcDescriptors::kOther, |
| 827 locs()); | 831 locs()); |
| 828 } | 832 } |
| 829 __ popq(result); | 833 __ popq(result); |
| 830 } | 834 } |
| 831 | 835 |
| 832 | 836 |
| 833 static bool CanBeImmediateIndex(Value* index, intptr_t cid) { | 837 static bool CanBeImmediateIndex(Value* index, intptr_t cid) { |
| (...skipping 5947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6781 __ Drop(1); | 6785 __ Drop(1); |
| 6782 __ popq(result); | 6786 __ popq(result); |
| 6783 } | 6787 } |
| 6784 | 6788 |
| 6785 | 6789 |
| 6786 } // namespace dart | 6790 } // namespace dart |
| 6787 | 6791 |
| 6788 #undef __ | 6792 #undef __ |
| 6789 | 6793 |
| 6790 #endif // defined TARGET_ARCH_X64 | 6794 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |