Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(702)

Side by Side Diff: runtime/vm/intermediate_language_arm.cc

Issue 315223003: Use CallBootstrapC stub for leaf native calls. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 if (!function().HasOptionalParameters()) { 917 if (!function().HasOptionalParameters()) {
918 __ AddImmediate(R2, FP, (kParamEndSlotFromFp + 918 __ AddImmediate(R2, FP, (kParamEndSlotFromFp +
919 function().NumParameters()) * kWordSize); 919 function().NumParameters()) * kWordSize);
920 } else { 920 } else {
921 __ AddImmediate(R2, FP, kFirstLocalSlotFromFp * kWordSize); 921 __ AddImmediate(R2, FP, kFirstLocalSlotFromFp * kWordSize);
922 } 922 }
923 // Compute the effective address. When running under the simulator, 923 // Compute the effective address. When running under the simulator,
924 // this is a redirection address that forces the simulator to call 924 // this is a redirection address that forces the simulator to call
925 // into the runtime system. 925 // into the runtime system.
926 uword entry = reinterpret_cast<uword>(native_c_function()); 926 uword entry = reinterpret_cast<uword>(native_c_function());
927 const intptr_t argc_tag = NativeArguments::ComputeArgcTag(function());
928 const bool is_leaf_call =
929 (argc_tag & NativeArguments::AutoSetupScopeMask()) == 0;
927 const ExternalLabel* stub_entry; 930 const ExternalLabel* stub_entry;
928 if (is_bootstrap_native()) { 931 if (is_bootstrap_native() || is_leaf_call) {
929 stub_entry = &StubCode::CallBootstrapCFunctionLabel(); 932 stub_entry = &StubCode::CallBootstrapCFunctionLabel();
930 #if defined(USING_SIMULATOR) 933 #if defined(USING_SIMULATOR)
931 entry = Simulator::RedirectExternalReference( 934 entry = Simulator::RedirectExternalReference(
932 entry, Simulator::kBootstrapNativeCall, function().NumParameters()); 935 entry, Simulator::kBootstrapNativeCall, function().NumParameters());
933 #endif 936 #endif
934 } else { 937 } else {
935 // In the case of non bootstrap native methods the CallNativeCFunction 938 // In the case of non bootstrap native methods the CallNativeCFunction
936 // stub generates the redirection address when running under the simulator 939 // stub generates the redirection address when running under the simulator
937 // and hence we do not change 'entry' here. 940 // and hence we do not change 'entry' here.
938 stub_entry = &StubCode::CallNativeCFunctionLabel(); 941 stub_entry = &StubCode::CallNativeCFunctionLabel();
939 #if defined(USING_SIMULATOR) 942 #if defined(USING_SIMULATOR)
940 if (!function().IsNativeAutoSetupScope()) { 943 if (!function().IsNativeAutoSetupScope()) {
941 entry = Simulator::RedirectExternalReference( 944 entry = Simulator::RedirectExternalReference(
942 entry, Simulator::kBootstrapNativeCall, function().NumParameters()); 945 entry, Simulator::kBootstrapNativeCall, function().NumParameters());
943 } 946 }
944 #endif 947 #endif
945 } 948 }
946 __ LoadImmediate(R5, entry); 949 __ LoadImmediate(R5, entry);
947 __ LoadImmediate(R1, NativeArguments::ComputeArgcTag(function())); 950 __ LoadImmediate(R1, argc_tag);
948 compiler->GenerateCall(token_pos(), 951 compiler->GenerateCall(token_pos(),
949 stub_entry, 952 stub_entry,
950 PcDescriptors::kOther, 953 PcDescriptors::kOther,
951 locs()); 954 locs());
952 __ Pop(result); 955 __ Pop(result);
953 } 956 }
954 957
955 958
956 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(Isolate* isolate, 959 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(Isolate* isolate,
957 bool opt) const { 960 bool opt) const {
(...skipping 5389 matching lines...) Expand 10 before | Expand all | Expand 10 after
6347 compiler->GenerateCall(token_pos(), 6350 compiler->GenerateCall(token_pos(),
6348 &label, 6351 &label,
6349 PcDescriptors::kOther, 6352 PcDescriptors::kOther,
6350 locs()); 6353 locs());
6351 __ Drop(ArgumentCount()); // Discard arguments. 6354 __ Drop(ArgumentCount()); // Discard arguments.
6352 } 6355 }
6353 6356
6354 } // namespace dart 6357 } // namespace dart
6355 6358
6356 #endif // defined TARGET_ARCH_ARM 6359 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/intermediate_language_arm64.cc » ('j') | runtime/vm/intermediate_language_ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698