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

Unified Diff: src/arm/code-stubs-arm.cc

Issue 163413003: Add a premonomorphic state to the call target cache. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Missing a64 port added. Created 6 years, 10 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 | « src/a64/code-stubs-a64.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/code-stubs-arm.cc
diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc
index 282a6d87562981a3368c8a8c3e7a26e044afc443..b548c23d070532bf3c8c2e75f1dfdcf24e8dad94 100644
--- a/src/arm/code-stubs-arm.cc
+++ b/src/arm/code-stubs-arm.cc
@@ -3017,6 +3017,8 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
masm->isolate()->heap()->undefined_value());
ASSERT_EQ(*TypeFeedbackInfo::UninitializedSentinel(masm->isolate()),
masm->isolate()->heap()->the_hole_value());
+ ASSERT_EQ(*TypeFeedbackInfo::PremonomorphicSentinel(masm->isolate()),
+ masm->isolate()->heap()->null_value());
// Load the cache state into r4.
__ add(r4, r2, Operand::PointerOffsetFromSmiKey(r3));
@@ -3043,10 +3045,26 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
__ bind(&miss);
- // A monomorphic miss (i.e, here the cache is not uninitialized) goes
- // megamorphic.
+ // A monomorphic miss (i.e, here the cache is not uninitialized or
+ // pre-monomorphic) goes megamorphic.
+ Label not_uninitialized;
__ CompareRoot(r4, Heap::kTheHoleValueRootIndex);
+ __ b(ne, &not_uninitialized);
+
+ // PremonomorphicSentinel is an immortal immovable object (null) so no
+ // write-barrier is needed.
+ __ add(r4, r2, Operand::PointerOffsetFromSmiKey(r3));
+ __ LoadRoot(ip, Heap::kNullValueRootIndex);
+ __ str(ip, FieldMemOperand(r4, FixedArray::kHeaderSize));
+ __ jmp(&done);
+
+ // If the cache isn't uninitialized, it is either premonomorphic or
+ // monomorphic. If it is premonomorphic, we initialize it thus making
+ // it monomorphic. Otherwise, we go megamorphic.
+ __ bind(&not_uninitialized);
+ __ CompareRoot(r4, Heap::kNullValueRootIndex);
__ b(eq, &initialize);
+
// MegamorphicSentinel is an immortal immovable object (undefined) so no
// write-barrier is needed.
__ bind(&megamorphic);
« no previous file with comments | « src/a64/code-stubs-a64.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698