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

Unified Diff: runtime/vm/stub_code_arm.cc

Issue 221173011: Simplify handling of IC and megamorphic cache misses. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: rebased Created 6 years, 8 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/stub_code.h ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_arm.cc
===================================================================
--- runtime/vm/stub_code_arm.cc (revision 34771)
+++ runtime/vm/stub_code_arm.cc (working copy)
@@ -437,40 +437,6 @@
}
-// Input parameters:
-// R5: ic-data.
-// R4: arguments descriptor array.
-// Note: The receiver object is the first argument to the function being
-// called, the stub accesses the receiver from this location directly
-// when trying to resolve the call.
-void StubCode::GenerateInstanceFunctionLookupStub(Assembler* assembler) {
zra 2014/04/07 14:32:12 Now that I've started on the arm64 port, it would
- __ EnterStubFrame();
-
- // Load the receiver.
- __ ldr(R2, FieldAddress(R4, ArgumentsDescriptor::count_offset()));
- __ add(IP, FP, ShifterOperand(R2, LSL, 1)); // R2 is Smi.
- __ ldr(R6, Address(IP, kParamEndSlotFromFp * kWordSize));
-
- // Push space for the return value.
- // Push the receiver.
- // Push IC data object.
- // Push arguments descriptor array.
- __ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null()));
- __ PushList((1 << R4) | (1 << R5) | (1 << R6) | (1 << IP));
-
- // R2: Smi-tagged arguments array length.
- PushArgumentsArray(assembler);
-
- __ CallRuntime(kInstanceFunctionLookupRuntimeEntry, 4);
-
- // Remove arguments.
- __ Drop(4);
- __ Pop(R0); // Get result into R0.
- __ LeaveStubFrame();
- __ Ret();
-}
-
-
DECLARE_LEAF_RUNTIME_ENTRY(intptr_t, DeoptimizeCopyFrame,
intptr_t deopt_reason,
uword saved_registers_address);
@@ -615,17 +581,18 @@
__ CallRuntime(kMegamorphicCacheMissHandlerRuntimeEntry, 3);
// Remove arguments.
__ Drop(3);
- __ Pop(R0); // Get result into R0.
+ __ Pop(R0); // Get result into R0 (target function).
// Restore IC data and arguments descriptor.
__ PopList((1 << R4) | (1 << R5));
__ LeaveStubFrame();
- __ CompareImmediate(R0, reinterpret_cast<intptr_t>(Object::null()));
- __ Branch(&StubCode::InstanceFunctionLookupLabel(), EQ);
- __ AddImmediate(R0, Instructions::HeaderSize() - kHeapObjectTag);
- __ bx(R0);
+ // Tail-call to target function.
+ __ ldr(R2, FieldAddress(R0, Function::code_offset()));
+ __ ldr(R2, FieldAddress(R2, Code::instructions_offset()));
+ __ AddImmediate(R2, Instructions::HeaderSize() - kHeapObjectTag);
+ __ bx(R2);
}
@@ -1465,19 +1432,12 @@
__ CallRuntime(handle_ic_miss, num_args + 1);
// Remove the call arguments pushed earlier, including the IC data object.
__ Drop(num_args + 1);
- // Pop returned code object into R0 (null if not found).
+ // Pop returned function object into R0.
// Restore arguments descriptor array and IC data array.
__ PopList((1 << R0) | (1 << R4) | (1 << R5));
__ LeaveStubFrame();
Label call_target_function;
- __ CompareImmediate(R0, reinterpret_cast<intptr_t>(Object::null()));
- __ b(&call_target_function, NE);
- // NoSuchMethod or closure.
- // Mark IC call that it may be a closure call that does not collect
- // type feedback.
- __ mov(IP, ShifterOperand(1));
- __ strb(IP, FieldAddress(R5, ICData::is_closure_call_offset()));
- __ Branch(&StubCode::InstanceFunctionLookupLabel());
+ __ b(&call_target_function);
__ Bind(&found);
// R6: pointer to an IC data check group.
« no previous file with comments | « runtime/vm/stub_code.h ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698