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

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

Issue 22303002: Auto create ApiLocalScope before calling native functions, this ensures that (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 if (!function().HasOptionalParameters()) { 1049 if (!function().HasOptionalParameters()) {
1050 __ AddImmediate(A2, FP, (kParamEndSlotFromFp + 1050 __ AddImmediate(A2, FP, (kParamEndSlotFromFp +
1051 function().NumParameters()) * kWordSize); 1051 function().NumParameters()) * kWordSize);
1052 } else { 1052 } else {
1053 __ AddImmediate(A2, FP, kFirstLocalSlotFromFp * kWordSize); 1053 __ AddImmediate(A2, FP, kFirstLocalSlotFromFp * kWordSize);
1054 } 1054 }
1055 // Compute the effective address. When running under the simulator, 1055 // Compute the effective address. When running under the simulator,
1056 // this is a redirection address that forces the simulator to call 1056 // this is a redirection address that forces the simulator to call
1057 // into the runtime system. 1057 // into the runtime system.
1058 uword entry = reinterpret_cast<uword>(native_c_function()); 1058 uword entry = reinterpret_cast<uword>(native_c_function());
1059 const ExternalLabel* stub_entry;
1060 if (is_bootstrap_native()) {
1061 stub_entry = &StubCode::CallBootstrapCFunctionLabel();
1059 #if defined(USING_SIMULATOR) 1062 #if defined(USING_SIMULATOR)
1060 entry = Simulator::RedirectExternalReference(entry, 1063 entry = Simulator::RedirectExternalReference(
1061 Simulator::kNativeCall, 1064 entry, Simulator::kBootstrapNativeCall, function().NumParameters());
1062 function().NumParameters());
1063 #endif 1065 #endif
1066 } else {
1067 stub_entry = &StubCode::CallNativeCFunctionLabel();
1068 }
1064 __ LoadImmediate(T5, entry); 1069 __ LoadImmediate(T5, entry);
1065 __ LoadImmediate(A1, NativeArguments::ComputeArgcTag(function())); 1070 __ LoadImmediate(A1, NativeArguments::ComputeArgcTag(function()));
1066 compiler->GenerateCall(token_pos(), 1071 compiler->GenerateCall(token_pos(),
1067 &StubCode::CallNativeCFunctionLabel(), 1072 stub_entry,
1068 PcDescriptors::kOther, 1073 PcDescriptors::kOther,
1069 locs()); 1074 locs());
1070 __ Pop(result); 1075 __ Pop(result);
1071 } 1076 }
1072 1077
1073 1078
1074 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary() const { 1079 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary() const {
1075 const intptr_t kNumInputs = 1; 1080 const intptr_t kNumInputs = 1;
1076 // TODO(fschneider): Allow immediate operands for the char code. 1081 // TODO(fschneider): Allow immediate operands for the char code.
1077 return LocationSummary::Make(kNumInputs, 1082 return LocationSummary::Make(kNumInputs,
(...skipping 2791 matching lines...) Expand 10 before | Expand all | Expand 10 after
3869 compiler->GenerateCall(token_pos(), 3874 compiler->GenerateCall(token_pos(),
3870 &label, 3875 &label,
3871 PcDescriptors::kOther, 3876 PcDescriptors::kOther,
3872 locs()); 3877 locs());
3873 __ Drop(2); // Discard type arguments and receiver. 3878 __ Drop(2); // Discard type arguments and receiver.
3874 } 3879 }
3875 3880
3876 } // namespace dart 3881 } // namespace dart
3877 3882
3878 #endif // defined TARGET_ARCH_MIPS 3883 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698