Add non-miss slow path to LoadIC_Normal.

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
This commit is contained in:
jkummerow@chromium.org 2014-06-12 16:38:37 +00:00
parent 5c96e2cff1
commit 918efd7e20
6 changed files with 36 additions and 12 deletions

View 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);

View 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);

View 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);

View 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);

View 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);

View 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);