Reviewers: Yang,
Message:
PTAL.
Description:
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
Please review this at https://codereview.chromium.org/328353002/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+36, -12 lines):
M src/arm/ic-arm.cc
M src/arm64/ic-arm64.cc
M src/ia32/ic-ia32.cc
M src/mips/ic-mips.cc
M src/x64/ic-x64.cc
M src/x87/ic-x87.cc
Index: src/arm/ic-arm.cc
diff --git a/src/arm/ic-arm.cc b/src/arm/ic-arm.cc
index
133404c1b3ce9933466370ba5bb0db7220a2d701..1028f8fd2b81fe6c5599ca26a6d243129b453aff
100644
--- a/src/arm/ic-arm.cc
+++ b/src/arm/ic-arm.cc
@@ -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: src/arm64/ic-arm64.cc
diff --git a/src/arm64/ic-arm64.cc b/src/arm64/ic-arm64.cc
index
d835d0fa5e25f0bc25a5a29d14d5d5535a0f9a3a..842b3e75dcbf65d805bbbe3f6af2086e5b7aff01
100644
--- a/src/arm64/ic-arm64.cc
+++ b/src/arm64/ic-arm64.cc
@@ -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: src/ia32/ic-ia32.cc
diff --git a/src/ia32/ic-ia32.cc b/src/ia32/ic-ia32.cc
index
83a4496b73ee047b2eeec162929352c99f286e85..b0e4ca0c60c2675899383b5a0fd95fe16546115d
100644
--- a/src/ia32/ic-ia32.cc
+++ b/src/ia32/ic-ia32.cc
@@ -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: src/mips/ic-mips.cc
diff --git a/src/mips/ic-mips.cc b/src/mips/ic-mips.cc
index
ea8601f9de635ba45475d89330626450040a0b2c..834135cc031e14df1658e93b173443999318968c
100644
--- a/src/mips/ic-mips.cc
+++ b/src/mips/ic-mips.cc
@@ -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: src/x64/ic-x64.cc
diff --git a/src/x64/ic-x64.cc b/src/x64/ic-x64.cc
index
578aea7ca208452e56324abfa8117f28a5215121..0cda1df16bd000674e60b600e7c0af54ab5edbdf
100644
--- a/src/x64/ic-x64.cc
+++ b/src/x64/ic-x64.cc
@@ -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: src/x87/ic-x87.cc
diff --git a/src/x87/ic-x87.cc b/src/x87/ic-x87.cc
index
ec126f70891c31c9fb144e3378e488b040952907..6cd9ac4e68312fa8002f2a548361d0c04b11232d
100644
--- a/src/x87/ic-x87.cc
+++ b/src/x87/ic-x87.cc
@@ -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);
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.