From: jarin Date: Fri, 30 Jan 2015 14:35:27 +0000 (-0800) Subject: Always emit bailout id for inlining property access (even for keyed access). X-Git-Tag: upstream/4.7.83~4681 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=da90aabc072e2321f5902252e51ce0afadd3d76a;p=platform%2Fupstream%2Fv8.git Always emit bailout id for inlining property access (even for keyed access). R=ulan@chromium.org BUG=chromium:453805 LOG=n Review URL: https://codereview.chromium.org/887023003 Cr-Commit-Position: refs/heads/master@{#26359} --- diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc index ad0c817..6139806 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); } diff --git a/src/arm64/full-codegen-arm64.cc b/src/arm64/full-codegen-arm64.cc index a013543..491e900 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); } diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc index af5fe45..5a161e9 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); } diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc index dc85538..bd408d9 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); } diff --git a/src/mips64/full-codegen-mips64.cc b/src/mips64/full-codegen-mips64.cc index 00791c0..9e79bcb 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); } diff --git a/src/ppc/full-codegen-ppc.cc b/src/ppc/full-codegen-ppc.cc index e926d6e..5b89437 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); } diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc index db49e75..3a93117 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); } diff --git a/src/x87/full-codegen-x87.cc b/src/x87/full-codegen-x87.cc index 9680974..8b8ef52 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); } 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 0000000..ed63133 --- /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());