Add non-miss slow path to LoadIC_Normal.
authorjkummerow@chromium.org <jkummerow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 12 Jun 2014 16:38:37 +0000 (16:38 +0000)
committerjkummerow@chromium.org <jkummerow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 12 Jun 2014 16:38:37 +0000 (16:38 +0000)
This avoids endless IC patching cycles between "normal" and "nonexistent" handlers when objects having and not having the property are seen alternatingly

R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/328353002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21816 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/arm/ic-arm.cc
src/arm64/ic-arm64.cc
src/ia32/ic-ia32.cc
src/mips/ic-mips.cc
src/x64/ic-x64.cc
src/x87/ic-x87.cc

index 133404c..1028f8f 100644 (file)
@@ -333,14 +333,18 @@ void LoadIC::GenerateNormal(MacroAssembler* masm) {
   //  -- lr    : return address
   //  -- r0    : receiver
   // -----------------------------------
-  Label miss;
+  Label miss, slow;
 
   GenerateNameDictionaryReceiverCheck(masm, r0, r1, r3, r4, &miss);
 
   // r1: elements
-  GenerateDictionaryLoad(masm, &miss, r1, r2, r0, r3, r4);
+  GenerateDictionaryLoad(masm, &slow, r1, r2, r0, r3, r4);
   __ Ret();
 
+  // Dictionary load failed, go slow (but don't miss).
+  __ bind(&slow);
+  GenerateRuntimeGetProperty(masm);
+
   // Cache miss: Jump to runtime.
   __ bind(&miss);
   GenerateMiss(masm);
index d835d0f..842b3e7 100644 (file)
@@ -429,14 +429,18 @@ void LoadIC::GenerateNormal(MacroAssembler* masm) {
   //  -- lr    : return address
   //  -- x0    : receiver
   // -----------------------------------
-  Label miss;
+  Label miss, slow;
 
   GenerateNameDictionaryReceiverCheck(masm, x0, x1, x3, x4, &miss);
 
   // x1 now holds the property dictionary.
-  GenerateDictionaryLoad(masm, &miss, x1, x2, x0, x3, x4);
+  GenerateDictionaryLoad(masm, &slow, x1, x2, x0, x3, x4);
   __ Ret();
 
+  // Dictionary load failed, go slow (but don't miss).
+  __ Bind(&slow);
+  GenerateRuntimeGetProperty(masm);
+
   // Cache miss: Jump to runtime.
   __ Bind(&miss);
   GenerateMiss(masm);
index 83a4496..b0e4ca0 100644 (file)
@@ -947,15 +947,19 @@ void LoadIC::GenerateNormal(MacroAssembler* masm) {
   //  -- edx    : receiver
   //  -- esp[0] : return address
   // -----------------------------------
-  Label miss;
+  Label miss, slow;
 
   GenerateNameDictionaryReceiverCheck(masm, edx, eax, ebx, &miss);
 
   // eax: elements
   // Search the dictionary placing the result in eax.
-  GenerateDictionaryLoad(masm, &miss, eax, ecx, edi, ebx, eax);
+  GenerateDictionaryLoad(masm, &slow, eax, ecx, edi, ebx, eax);
   __ ret(0);
 
+  // Dictionary load failed, go slow (but don't miss).
+  __ bind(&slow);
+  GenerateRuntimeGetProperty(masm);
+
   // Cache miss: Jump to runtime.
   __ bind(&miss);
   GenerateMiss(masm);
index ea8601f..834135c 100644 (file)
@@ -339,14 +339,18 @@ void LoadIC::GenerateNormal(MacroAssembler* masm) {
   //  -- lr    : return address
   //  -- a0    : receiver
   // -----------------------------------
-  Label miss;
+  Label miss, slow;
 
   GenerateNameDictionaryReceiverCheck(masm, a0, a1, a3, t0, &miss);
 
   // a1: elements
-  GenerateDictionaryLoad(masm, &miss, a1, a2, v0, a3, t0);
+  GenerateDictionaryLoad(masm, &slow, a1, a2, v0, a3, t0);
   __ Ret();
 
+  // Dictionary load failed, go slow (but don't miss).
+  __ bind(&slow);
+  GenerateRuntimeGetProperty(masm);
+
   // Cache miss: Jump to runtime.
   __ bind(&miss);
   GenerateMiss(masm);
index 578aea7..0cda1df 100644 (file)
@@ -972,15 +972,19 @@ void LoadIC::GenerateNormal(MacroAssembler* masm) {
   //  -- rcx    : name
   //  -- rsp[0] : return address
   // -----------------------------------
-  Label miss;
+  Label miss, slow;
 
   GenerateNameDictionaryReceiverCheck(masm, rax, rdx, rbx, &miss);
 
   //  rdx: elements
   // Search the dictionary placing the result in rax.
-  GenerateDictionaryLoad(masm, &miss, rdx, rcx, rbx, rdi, rax);
+  GenerateDictionaryLoad(masm, &slow, rdx, rcx, rbx, rdi, rax);
   __ ret(0);
 
+  // Dictionary load failed, go slow (but don't miss).
+  __ bind(&slow);
+  GenerateRuntimeGetProperty(masm);
+
   // Cache miss: Jump to runtime.
   __ bind(&miss);
   GenerateMiss(masm);
index ec126f7..6cd9ac4 100644 (file)
@@ -947,15 +947,19 @@ void LoadIC::GenerateNormal(MacroAssembler* masm) {
   //  -- edx    : receiver
   //  -- esp[0] : return address
   // -----------------------------------
-  Label miss;
+  Label miss, slow;
 
   GenerateNameDictionaryReceiverCheck(masm, edx, eax, ebx, &miss);
 
   // eax: elements
   // Search the dictionary placing the result in eax.
-  GenerateDictionaryLoad(masm, &miss, eax, ecx, edi, ebx, eax);
+  GenerateDictionaryLoad(masm, &slow, eax, ecx, edi, ebx, eax);
   __ ret(0);
 
+  // Dictionary load failed, go slow (but don't miss).
+  __ bind(&slow);
+  GenerateRuntimeGetProperty(masm);
+
   // Cache miss: Jump to runtime.
   __ bind(&miss);
   GenerateMiss(masm);