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

Unified Diff: runtime/vm/flow_graph_compiler_mips.cc

Issue 17857008: Fix and simplify invocation of noSuchMethod on all platforms after the wrong (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/flow_graph_compiler_ia32.cc ('k') | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_mips.cc
===================================================================
--- runtime/vm/flow_graph_compiler_mips.cc (revision 24483)
+++ runtime/vm/flow_graph_compiler_mips.cc (working copy)
@@ -920,16 +920,6 @@
}
__ Bind(&wrong_num_arguments);
- if (StackSize() != 0) {
- // We need to unwind the space we reserved for locals and copied parameters.
- // The NoSuchMethodFunction stub does not expect to see that area on the
- // stack.
- __ AddImmediate(SP, StackSize() * kWordSize);
- }
- // The call below has an empty stackmap because we have just
- // dropped the spill slots.
- BitmapBuilder* empty_stack_bitmap = new BitmapBuilder();
-
// Invoke noSuchMethod function passing the original name of the function.
// If the function is a closure function, use "call" as the original name.
const String& name = String::Handle(
@@ -939,25 +929,10 @@
ICData::New(function, name, Object::null_array(),
Isolate::kNoDeoptId, kNumArgsChecked));
__ LoadObject(S5, ic_data);
- // FP - 4 : saved PP, object pool pointer of caller.
- // FP + 0 : previous frame pointer.
- // FP + 4 : return address.
- // FP + 8 : PC marker, for easy identification of RawInstruction obj.
- // FP + 12: last argument (arg n-1).
- // SP + 0 : saved PP.
- // SP + 16 + 4*(n-1) : first argument (arg 0).
- // S5 : ic-data.
- // S4 : arguments descriptor array.
- __ BranchLink(&StubCode::CallNoSuchMethodFunctionLabel());
- // Emit descriptors in order to provide correct postion in stacktrace.
- AddCurrentDescriptor(PcDescriptors::kOther, -1, function.token_pos());
- if (is_optimizing()) {
- stackmap_table_builder_->AddEntry(assembler()->CodeSize(),
- empty_stack_bitmap,
- 0); // No registers.
- }
- // The noSuchMethod call may return.
- __ LeaveDartFrameAndReturn();
+ __ LeaveDartFrame(); // The arguments are still on the stack.
+ __ Branch(&StubCode::CallNoSuchMethodFunctionLabel());
+ // The noSuchMethod call may return to the caller, but not here.
+ __ break_(0);
__ Bind(&all_arguments_processed);
// Nullify originally passed arguments only after they have been copied and
@@ -1134,16 +1109,6 @@
__ beq(T0, T1, &correct_num_arguments);
__ Bind(&wrong_num_arguments);
if (function.IsClosureFunction() || function.IsNoSuchMethodDispatcher()) {
- if (StackSize() != 0) {
- // We need to unwind the space we reserved for locals and copied
- // parameters. The NoSuchMethodFunction stub does not expect to see
- // that area on the stack.
- __ AddImmediate(SP, StackSize() * kWordSize);
- }
- // The call below has an empty stackmap because we have just
- // dropped the spill slots.
- BitmapBuilder* empty_stack_bitmap = new BitmapBuilder();
-
// Invoke noSuchMethod function passing the original function name.
// For closure functions, use "call" as the original name.
const String& name =
@@ -1155,25 +1120,10 @@
ICData::New(function, name, Object::null_array(),
Isolate::kNoDeoptId, kNumArgsChecked));
__ LoadObject(S5, ic_data);
- // FP - 4 : saved PP, object pool pointer of caller.
- // FP + 0 : previous frame pointer.
- // FP + 4 : return address.
- // FP + 8 : PC marker, for easy identification of RawInstruction obj.
- // FP + 12: last argument (arg n-1).
- // SP + 0 : saved PP.
- // SP + 16 + 4*(n-1) : first argument (arg 0).
- // S5 : ic-data.
- // S4 : arguments descriptor array.
- __ BranchLink(&StubCode::CallNoSuchMethodFunctionLabel());
- // Emit descriptors in order to provide correct postion in stacktrace.
- AddCurrentDescriptor(PcDescriptors::kOther, -1, function.token_pos());
- if (is_optimizing()) {
- stackmap_table_builder_->AddEntry(assembler()->CodeSize(),
- empty_stack_bitmap,
- 0); // No registers.
- }
- // The noSuchMethod call may return.
- __ LeaveDartFrameAndReturn();
+ __ LeaveDartFrame(); // The arguments are still on the stack.
+ __ Branch(&StubCode::CallNoSuchMethodFunctionLabel());
+ // The noSuchMethod call may return to the caller, but not here.
+ __ break_(0);
} else {
__ Stop("Wrong number of arguments");
}
« no previous file with comments | « runtime/vm/flow_graph_compiler_ia32.cc ('k') | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698