Reviewers: ulan,
Message:
Could you take a look, please?
Description:
Always emit bailout id for inlining property access (even for keyed access).
[email protected]
BUG=chromium:453805
LOG=n
Please review this at https://codereview.chromium.org/887023003/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+38, -24 lines):
M src/arm/full-codegen-arm.cc
M src/arm64/full-codegen-arm64.cc
M src/ia32/full-codegen-ia32.cc
M src/mips/full-codegen-mips.cc
M src/mips64/full-codegen-mips64.cc
M src/ppc/full-codegen-ppc.cc
M src/x64/full-codegen-x64.cc
M src/x87/full-codegen-x87.cc
A test/mjsunit/regress/regress-deoptimize-constant-keyed-load.js
Index: src/arm/full-codegen-arm.cc
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc
index
ad0c8174f1f41cccc4220c4e266ef449427eb7c9..6139806f909405a612bcfb68cc6f267a496c40a4
100644
--- a/src/arm/full-codegen-arm.cc
+++ b/src/arm/full-codegen-arm.cc
@@ -2827,8 +2827,6 @@ void FullCodeGenerator::VisitProperty(Property* expr)
{
__ Push(result_register());
EmitNamedSuperPropertyLoad(expr);
}
- PrepareForBailoutForId(expr->LoadId(), TOS_REG);
- context()->Plug(r0);
} else {
if (!expr->IsSuperAccess()) {
VisitForStackValue(expr->obj());
@@ -2843,8 +2841,9 @@ void FullCodeGenerator::VisitProperty(Property* expr)
{
VisitForStackValue(expr->key());
EmitKeyedSuperPropertyLoad(expr);
}
- context()->Plug(r0);
}
+ PrepareForBailoutForId(expr->LoadId(), TOS_REG);
+ context()->Plug(r0);
}
Index: src/arm64/full-codegen-arm64.cc
diff --git a/src/arm64/full-codegen-arm64.cc
b/src/arm64/full-codegen-arm64.cc
index
a013543998fda0a136e3eef251bd81b2648a33a0..491e9000d39fbd2ce62bddffb3971385f81ab87b
100644
--- a/src/arm64/full-codegen-arm64.cc
+++ b/src/arm64/full-codegen-arm64.cc
@@ -2518,8 +2518,6 @@ void FullCodeGenerator::VisitProperty(Property* expr)
{
__ Push(result_register());
EmitNamedSuperPropertyLoad(expr);
}
- PrepareForBailoutForId(expr->LoadId(), TOS_REG);
- context()->Plug(x0);
} else {
if (!expr->IsSuperAccess()) {
VisitForStackValue(expr->obj());
@@ -2534,8 +2532,9 @@ void FullCodeGenerator::VisitProperty(Property* expr)
{
VisitForStackValue(expr->key());
EmitKeyedSuperPropertyLoad(expr);
}
- context()->Plug(x0);
}
+ PrepareForBailoutForId(expr->LoadId(), TOS_REG);
+ context()->Plug(x0);
}
Index: src/ia32/full-codegen-ia32.cc
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc
index
af5fe45e25242eb7469f1bb99ebbea752c4a04c4..5a161e9763928ab2f49cfc16670dd3b2e244a94e
100644
--- a/src/ia32/full-codegen-ia32.cc
+++ b/src/ia32/full-codegen-ia32.cc
@@ -2736,8 +2736,6 @@ void FullCodeGenerator::VisitProperty(Property* expr)
{
__ push(result_register());
EmitNamedSuperPropertyLoad(expr);
}
- PrepareForBailoutForId(expr->LoadId(), TOS_REG);
- context()->Plug(eax);
} else {
if (!expr->IsSuperAccess()) {
VisitForStackValue(expr->obj());
@@ -2752,8 +2750,9 @@ void FullCodeGenerator::VisitProperty(Property* expr)
{
VisitForStackValue(expr->key());
EmitKeyedSuperPropertyLoad(expr);
}
- context()->Plug(eax);
}
+ PrepareForBailoutForId(expr->LoadId(), TOS_REG);
+ context()->Plug(eax);
}
Index: src/mips/full-codegen-mips.cc
diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc
index
dc85538c3e97f950acad1cea85da98af8383bd28..bd408d9b0602d5edacc78b0e1f2ecb8fc8eef739
100644
--- a/src/mips/full-codegen-mips.cc
+++ b/src/mips/full-codegen-mips.cc
@@ -2811,8 +2811,6 @@ void FullCodeGenerator::VisitProperty(Property* expr)
{
__ Push(result_register());
EmitNamedSuperPropertyLoad(expr);
}
- PrepareForBailoutForId(expr->LoadId(), TOS_REG);
- context()->Plug(v0);
} else {
if (!expr->IsSuperAccess()) {
VisitForStackValue(expr->obj());
@@ -2827,8 +2825,9 @@ void FullCodeGenerator::VisitProperty(Property* expr)
{
VisitForStackValue(expr->key());
EmitKeyedSuperPropertyLoad(expr);
}
- context()->Plug(v0);
}
+ PrepareForBailoutForId(expr->LoadId(), TOS_REG);
+ context()->Plug(v0);
}
Index: src/mips64/full-codegen-mips64.cc
diff --git a/src/mips64/full-codegen-mips64.cc
b/src/mips64/full-codegen-mips64.cc
index
00791c0c9df1540106478370e91364c7be870759..9e79bcbb56f6caaeff157808a5905a1f6eb979f1
100644
--- a/src/mips64/full-codegen-mips64.cc
+++ b/src/mips64/full-codegen-mips64.cc
@@ -2811,8 +2811,6 @@ void FullCodeGenerator::VisitProperty(Property* expr)
{
__ Push(result_register());
EmitNamedSuperPropertyLoad(expr);
}
- PrepareForBailoutForId(expr->LoadId(), TOS_REG);
- context()->Plug(v0);
} else {
if (!expr->IsSuperAccess()) {
VisitForStackValue(expr->obj());
@@ -2827,8 +2825,9 @@ void FullCodeGenerator::VisitProperty(Property* expr)
{
VisitForStackValue(expr->key());
EmitKeyedSuperPropertyLoad(expr);
}
- context()->Plug(v0);
}
+ PrepareForBailoutForId(expr->LoadId(), TOS_REG);
+ context()->Plug(v0);
}
Index: src/ppc/full-codegen-ppc.cc
diff --git a/src/ppc/full-codegen-ppc.cc b/src/ppc/full-codegen-ppc.cc
index
e926d6ee27c88102aebac8bbdcb14a1f3f6221be..5b89437369dc7abb4ebc3ef00d2abb2f4309f9b6
100644
--- a/src/ppc/full-codegen-ppc.cc
+++ b/src/ppc/full-codegen-ppc.cc
@@ -2800,8 +2800,6 @@ void FullCodeGenerator::VisitProperty(Property* expr)
{
__ Push(result_register());
EmitNamedSuperPropertyLoad(expr);
}
- PrepareForBailoutForId(expr->LoadId(), TOS_REG);
- context()->Plug(r3);
} else {
if (!expr->IsSuperAccess()) {
VisitForStackValue(expr->obj());
@@ -2816,8 +2814,9 @@ void FullCodeGenerator::VisitProperty(Property* expr)
{
VisitForStackValue(expr->key());
EmitKeyedSuperPropertyLoad(expr);
}
- context()->Plug(r3);
}
+ PrepareForBailoutForId(expr->LoadId(), TOS_REG);
+ context()->Plug(r3);
}
Index: src/x64/full-codegen-x64.cc
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc
index
db49e75d495fc5a43769dd169feef16ec9d469f9..3a93117e385542c259016c087242a171bed3c289
100644
--- a/src/x64/full-codegen-x64.cc
+++ b/src/x64/full-codegen-x64.cc
@@ -2736,8 +2736,6 @@ void FullCodeGenerator::VisitProperty(Property* expr)
{
__ Push(result_register());
EmitNamedSuperPropertyLoad(expr);
}
- PrepareForBailoutForId(expr->LoadId(), TOS_REG);
- context()->Plug(rax);
} else {
if (!expr->IsSuperAccess()) {
VisitForStackValue(expr->obj());
@@ -2752,8 +2750,9 @@ void FullCodeGenerator::VisitProperty(Property* expr)
{
VisitForStackValue(expr->key());
EmitKeyedSuperPropertyLoad(expr);
}
- context()->Plug(rax);
}
+ PrepareForBailoutForId(expr->LoadId(), TOS_REG);
+ context()->Plug(rax);
}
Index: src/x87/full-codegen-x87.cc
diff --git a/src/x87/full-codegen-x87.cc b/src/x87/full-codegen-x87.cc
index
96809744fcecf8a40d13b12716269d72bff2e825..8b8ef5205d239d0eb1565057dd3207adb656d56b
100644
--- a/src/x87/full-codegen-x87.cc
+++ b/src/x87/full-codegen-x87.cc
@@ -2723,8 +2723,6 @@ void FullCodeGenerator::VisitProperty(Property* expr)
{
__ push(result_register());
EmitNamedSuperPropertyLoad(expr);
}
- PrepareForBailoutForId(expr->LoadId(), TOS_REG);
- context()->Plug(eax);
} else {
if (!expr->IsSuperAccess()) {
VisitForStackValue(expr->obj());
@@ -2739,8 +2737,9 @@ void FullCodeGenerator::VisitProperty(Property* expr)
{
VisitForStackValue(expr->key());
EmitKeyedSuperPropertyLoad(expr);
}
- context()->Plug(eax);
}
+ PrepareForBailoutForId(expr->LoadId(), TOS_REG);
+ context()->Plug(eax);
}
Index: test/mjsunit/regress/regress-deoptimize-constant-keyed-load.js
diff --git a/test/mjsunit/regress/regress-deoptimize-constant-keyed-load.js
b/test/mjsunit/regress/regress-deoptimize-constant-keyed-load.js
new file mode 100644
index
0000000000000000000000000000000000000000..ed63133c0fc1bfe42c7b589122cb248ef9974ef1
--- /dev/null
+++ b/test/mjsunit/regress/regress-deoptimize-constant-keyed-load.js
@@ -0,0 +1,22 @@
+// Copyright 2015 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --allow-natives-syntax
+
+var o = { };
+o.__defineGetter__("progressChanged", function() { %DeoptimizeFunction(f);
return 10; })
+
+function g(a, b, c) {
+ return a + b + c;
+}
+
+function f() {
+ var t="progressChanged";
+ return g(1, o[t], 100);
+}
+
+f();
+f();
+%OptimizeFunctionOnNextCall(f);
+assertEquals(111, f());
--
--
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.