Add missing arity check for native entry in arm64 and mips simulators.
R=fschneider@google.com Review URL: https://codereview.chromium.org//1341623002 .
This commit is contained in:
@@ -184,7 +184,6 @@ void NativeEntry::LinkNativeCall(Dart_NativeArguments args) {
|
||||
bool call_through_wrapper = false;
|
||||
#ifdef USING_SIMULATOR
|
||||
bool is_native_auto_setup_scope = false;
|
||||
intptr_t num_parameters = -1;
|
||||
#endif
|
||||
|
||||
{
|
||||
@@ -197,7 +196,6 @@ void NativeEntry::LinkNativeCall(Dart_NativeArguments args) {
|
||||
const Function& func = Function::Handle(code.function());
|
||||
#ifdef USING_SIMULATOR
|
||||
is_native_auto_setup_scope = func.IsNativeAutoSetupScope();
|
||||
num_parameters = func.NumParameters();
|
||||
#endif
|
||||
|
||||
if (FLAG_trace_natives) {
|
||||
@@ -225,7 +223,7 @@ void NativeEntry::LinkNativeCall(Dart_NativeArguments args) {
|
||||
Simulator::RedirectExternalReference(
|
||||
reinterpret_cast<uword>(LinkNativeCall),
|
||||
Simulator::kBootstrapNativeCall,
|
||||
func.NumParameters())));
|
||||
NativeEntry::kNumArguments)));
|
||||
#endif
|
||||
ASSERT(current_trampoline ==
|
||||
StubCode::CallBootstrapCFunction_entry()->EntryPoint());
|
||||
@@ -248,7 +246,7 @@ void NativeEntry::LinkNativeCall(Dart_NativeArguments args) {
|
||||
patch_target_function = reinterpret_cast<NativeFunction>(
|
||||
Simulator::RedirectExternalReference(
|
||||
reinterpret_cast<uword>(patch_target_function),
|
||||
Simulator::kBootstrapNativeCall, num_parameters));
|
||||
Simulator::kBootstrapNativeCall, NativeEntry::kNumArguments));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1626,6 +1626,7 @@ void Simulator::DoRedirectedCall(Instr* instr) {
|
||||
set_vregisterd(V0, 0, bit_cast<int64_t, double>(res));
|
||||
set_vregisterd(V0, 1, 0);
|
||||
} else if (redirection->call_kind() == kBootstrapNativeCall) {
|
||||
ASSERT(redirection->argument_count() == 1);
|
||||
NativeArguments* arguments;
|
||||
arguments = reinterpret_cast<NativeArguments*>(get_register(R0));
|
||||
SimulatorBootstrapNativeCall target =
|
||||
|
||||
@@ -1268,6 +1268,7 @@ void Simulator::DoBreak(Instr *instr) {
|
||||
d0 = target(d6, d7);
|
||||
set_fregister_double(F0, d0);
|
||||
} else if (redirection->call_kind() == kBootstrapNativeCall) {
|
||||
ASSERT(redirection->argument_count() == 1);
|
||||
NativeArguments* arguments;
|
||||
arguments = reinterpret_cast<NativeArguments*>(get_register(A0));
|
||||
SimulatorBootstrapNativeCall target =
|
||||
|
||||
Reference in New Issue
Block a user