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

Unified Diff: runtime/vm/stub_code_ia32.cc

Issue 11299298: Cache lookups at megamorphic call sites in optimized code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: One change I forgot. Created 8 years 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_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_ia32.cc
diff --git a/runtime/vm/stub_code_ia32.cc b/runtime/vm/stub_code_ia32.cc
index c56dc4b6f47a2ba73bc444bb35d32772c11d4391..034358baa9545d6c297f0adabbe29c62ff51cdbe 100644
--- a/runtime/vm/stub_code_ia32.cc
+++ b/runtime/vm/stub_code_ia32.cc
@@ -568,6 +568,44 @@ void StubCode::GenerateDeoptimizeStub(Assembler* assembler) {
}
+void StubCode::GenerateMegamorphicMissStub(Assembler* assembler) {
+ AssemblerMacros::EnterStubFrame(assembler);
+ // Load the receiver into EAX. The argument count in the arguments
+ // descriptor in EDX is a smi.
+ __ movl(EAX, FieldAddress(EDX, ArgumentsDescriptor::count_offset()));
+ // Two words (return addres, saved fp) in the stack above the last argument.
+ __ movl(EAX, Address(ESP, EAX, TIMES_2, 2 * kWordSize));
+ // Preserve IC data and arguments descriptor.
+ __ pushl(ECX);
+ __ pushl(EDX);
+
+ const Immediate raw_null =
+ Immediate(reinterpret_cast<intptr_t>(Instructions::null()));
+ __ pushl(raw_null); // Space for the result of the runtime call.
+ __ pushl(EAX); // Pass receiver.
+ __ pushl(ECX); // Pass IC data.
+ __ pushl(EDX); // Pass rguments descriptor.
+ __ CallRuntime(kMegamorphicCacheMissHandlerRuntimeEntry);
+ // Discard arguments.
+ __ popl(EAX);
+ __ popl(EAX);
+ __ popl(EAX);
+ __ popl(EAX); // Return value from the runtime call (instructions).
+ __ popl(EDX); // Restore arguments descriptor.
+ __ popl(ECX); // Restore IC data.
+ __ LeaveFrame();
+
+ Label lookup;
+ __ cmpl(EAX, raw_null);
+ __ j(EQUAL, &lookup, Assembler::kNearJump);
+ __ addl(EAX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
+ __ jmp(EAX);
+
+ __ Bind(&lookup);
+ __ jmp(&StubCode::InstanceFunctionLookupLabel());
+}
+
+
// Called for inline allocation of arrays.
// Input parameters:
// EDX : Array length as Smi.
« no previous file with comments | « runtime/vm/stub_code.h ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698