OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
7 | 7 |
8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 | 9 |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 uword entry; | 793 uword entry; |
794 const intptr_t argc_tag = NativeArguments::ComputeArgcTag(function()); | 794 const intptr_t argc_tag = NativeArguments::ComputeArgcTag(function()); |
795 const bool is_leaf_call = | 795 const bool is_leaf_call = |
796 (argc_tag & NativeArguments::AutoSetupScopeMask()) == 0; | 796 (argc_tag & NativeArguments::AutoSetupScopeMask()) == 0; |
797 const StubEntry* stub_entry; | 797 const StubEntry* stub_entry; |
798 if (link_lazily()) { | 798 if (link_lazily()) { |
799 stub_entry = StubCode::CallBootstrapCFunction_entry(); | 799 stub_entry = StubCode::CallBootstrapCFunction_entry(); |
800 entry = reinterpret_cast<uword>(&NativeEntry::LinkNativeCall); | 800 entry = reinterpret_cast<uword>(&NativeEntry::LinkNativeCall); |
801 #if defined(USING_SIMULATOR) | 801 #if defined(USING_SIMULATOR) |
802 entry = Simulator::RedirectExternalReference( | 802 entry = Simulator::RedirectExternalReference( |
803 entry, Simulator::kBootstrapNativeCall, function().NumParameters()); | 803 entry, Simulator::kBootstrapNativeCall, NativeEntry::kNumArguments); |
804 #endif | 804 #endif |
805 } else { | 805 } else { |
806 entry = reinterpret_cast<uword>(native_c_function()); | 806 entry = reinterpret_cast<uword>(native_c_function()); |
807 if (is_bootstrap_native() || is_leaf_call) { | 807 if (is_bootstrap_native() || is_leaf_call) { |
808 stub_entry = StubCode::CallBootstrapCFunction_entry(); | 808 stub_entry = StubCode::CallBootstrapCFunction_entry(); |
809 #if defined(USING_SIMULATOR) | 809 #if defined(USING_SIMULATOR) |
810 entry = Simulator::RedirectExternalReference( | 810 entry = Simulator::RedirectExternalReference( |
811 entry, Simulator::kBootstrapNativeCall, function().NumParameters()); | 811 entry, Simulator::kBootstrapNativeCall, NativeEntry::kNumArguments); |
812 #endif | 812 #endif |
813 } else { | 813 } else { |
814 // In the case of non bootstrap native methods the CallNativeCFunction | 814 // In the case of non bootstrap native methods the CallNativeCFunction |
815 // stub generates the redirection address when running under the simulator | 815 // stub generates the redirection address when running under the simulator |
816 // and hence we do not change 'entry' here. | 816 // and hence we do not change 'entry' here. |
817 stub_entry = StubCode::CallNativeCFunction_entry(); | 817 stub_entry = StubCode::CallNativeCFunction_entry(); |
818 #if defined(USING_SIMULATOR) | 818 #if defined(USING_SIMULATOR) |
819 if (!function().IsNativeAutoSetupScope()) { | 819 if (!function().IsNativeAutoSetupScope()) { |
820 entry = Simulator::RedirectExternalReference( | 820 entry = Simulator::RedirectExternalReference( |
821 entry, Simulator::kBootstrapNativeCall, function().NumParameters()); | 821 entry, Simulator::kBootstrapNativeCall, NativeEntry::kNumArguments); |
822 } | 822 } |
823 #endif | 823 #endif |
824 } | 824 } |
825 } | 825 } |
826 __ LoadImmediate(R1, argc_tag); | 826 __ LoadImmediate(R1, argc_tag); |
827 ExternalLabel label(entry); | 827 ExternalLabel label(entry); |
828 __ LoadExternalLabel(R5, &label); | 828 __ LoadNativeEntry(R5, &label); |
829 compiler->GenerateCall(token_pos(), | 829 compiler->GenerateCall(token_pos(), |
830 *stub_entry, | 830 *stub_entry, |
831 RawPcDescriptors::kOther, | 831 RawPcDescriptors::kOther, |
832 locs()); | 832 locs()); |
833 __ Pop(result); | 833 __ Pop(result); |
834 } | 834 } |
835 | 835 |
836 | 836 |
837 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(Zone* zone, | 837 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(Zone* zone, |
838 bool opt) const { | 838 bool opt) const { |
(...skipping 4785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5624 1, | 5624 1, |
5625 locs()); | 5625 locs()); |
5626 __ Drop(1); | 5626 __ Drop(1); |
5627 __ Pop(result); | 5627 __ Pop(result); |
5628 } | 5628 } |
5629 | 5629 |
5630 | 5630 |
5631 } // namespace dart | 5631 } // namespace dart |
5632 | 5632 |
5633 #endif // defined TARGET_ARCH_ARM64 | 5633 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |