Commit afb69f74 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[fullcodegen] Add missing bailout points for super calls.

The bailout points for named and keyed property loads when doing super
property calls are not being prepared by full-codegen, even though we
are using them in TurboFan for deopts and stack traces.

R=jarin@chromium.org
TEST=mjsunit/regress/regress-4971
BUG=v8:4971
LOG=n

Review-Url: https://codereview.chromium.org/1960083002
Cr-Commit-Position: refs/heads/master@{#36109}
parent 41deb5a2
......@@ -2429,6 +2429,7 @@ void FullCodeGenerator::EmitSuperCallWithLoadIC(Call* expr) {
// - home_object
// - key
CallRuntimeWithOperands(Runtime::kLoadFromSuper);
PrepareForBailoutForId(prop->LoadId(), TOS_REG);
// Replace home_object with target function.
__ str(r0, MemOperand(sp, kPointerSize));
......@@ -2489,6 +2490,7 @@ void FullCodeGenerator::EmitKeyedSuperCallWithLoadIC(Call* expr) {
// - home_object
// - key
CallRuntimeWithOperands(Runtime::kLoadKeyedFromSuper);
PrepareForBailoutForId(prop->LoadId(), TOS_REG);
// Replace home_object with target function.
__ str(r0, MemOperand(sp, kPointerSize));
......
......@@ -2327,6 +2327,7 @@ void FullCodeGenerator::EmitSuperCallWithLoadIC(Call* expr) {
// - home_object
// - key
CallRuntimeWithOperands(Runtime::kLoadFromSuper);
PrepareForBailoutForId(prop->LoadId(), TOS_REG);
// Replace home_object with target function.
__ Poke(x0, kPointerSize);
......@@ -2388,6 +2389,7 @@ void FullCodeGenerator::EmitKeyedSuperCallWithLoadIC(Call* expr) {
// - home_object
// - key
CallRuntimeWithOperands(Runtime::kLoadKeyedFromSuper);
PrepareForBailoutForId(prop->LoadId(), TOS_REG);
// Replace home_object with target function.
__ Poke(x0, kPointerSize);
......
......@@ -2329,6 +2329,7 @@ void FullCodeGenerator::EmitSuperCallWithLoadIC(Call* expr) {
// - home_object
// - key
CallRuntimeWithOperands(Runtime::kLoadFromSuper);
PrepareForBailoutForId(prop->LoadId(), TOS_REG);
// Replace home_object with target function.
__ mov(Operand(esp, kPointerSize), eax);
......@@ -2385,6 +2386,7 @@ void FullCodeGenerator::EmitKeyedSuperCallWithLoadIC(Call* expr) {
// - home_object
// - key
CallRuntimeWithOperands(Runtime::kLoadKeyedFromSuper);
PrepareForBailoutForId(prop->LoadId(), TOS_REG);
// Replace home_object with target function.
__ mov(Operand(esp, kPointerSize), eax);
......
......@@ -2435,6 +2435,7 @@ void FullCodeGenerator::EmitSuperCallWithLoadIC(Call* expr) {
// - home_object
// - key
CallRuntimeWithOperands(Runtime::kLoadFromSuper);
PrepareForBailoutForId(prop->LoadId(), TOS_REG);
// Replace home_object with target function.
__ sw(v0, MemOperand(sp, kPointerSize));
......@@ -2493,6 +2494,7 @@ void FullCodeGenerator::EmitKeyedSuperCallWithLoadIC(Call* expr) {
// - home_object
// - key
CallRuntimeWithOperands(Runtime::kLoadKeyedFromSuper);
PrepareForBailoutForId(prop->LoadId(), TOS_REG);
// Replace home_object with target function.
__ sw(v0, MemOperand(sp, kPointerSize));
......
......@@ -2434,6 +2434,7 @@ void FullCodeGenerator::EmitSuperCallWithLoadIC(Call* expr) {
// - home_object
// - key
CallRuntimeWithOperands(Runtime::kLoadFromSuper);
PrepareForBailoutForId(prop->LoadId(), TOS_REG);
// Replace home_object with target function.
__ sd(v0, MemOperand(sp, kPointerSize));
......@@ -2492,6 +2493,7 @@ void FullCodeGenerator::EmitKeyedSuperCallWithLoadIC(Call* expr) {
// - home_object
// - key
CallRuntimeWithOperands(Runtime::kLoadKeyedFromSuper);
PrepareForBailoutForId(prop->LoadId(), TOS_REG);
// Replace home_object with target function.
__ sd(v0, MemOperand(sp, kPointerSize));
......
......@@ -2426,6 +2426,7 @@ void FullCodeGenerator::EmitSuperCallWithLoadIC(Call* expr) {
// - home_object
// - key
CallRuntimeWithOperands(Runtime::kLoadFromSuper);
PrepareForBailoutForId(prop->LoadId(), TOS_REG);
// Replace home_object with target function.
__ StoreP(r3, MemOperand(sp, kPointerSize));
......@@ -2483,6 +2484,7 @@ void FullCodeGenerator::EmitKeyedSuperCallWithLoadIC(Call* expr) {
// - home_object
// - key
CallRuntimeWithOperands(Runtime::kLoadKeyedFromSuper);
PrepareForBailoutForId(prop->LoadId(), TOS_REG);
// Replace home_object with target function.
__ StoreP(r3, MemOperand(sp, kPointerSize));
......
......@@ -2372,6 +2372,7 @@ void FullCodeGenerator::EmitSuperCallWithLoadIC(Call* expr) {
// - home_object
// - key
CallRuntimeWithOperands(Runtime::kLoadFromSuper);
PrepareForBailoutForId(prop->LoadId(), TOS_REG);
// Replace home_object with target function.
__ StoreP(r2, MemOperand(sp, kPointerSize));
......@@ -2427,6 +2428,7 @@ void FullCodeGenerator::EmitKeyedSuperCallWithLoadIC(Call* expr) {
// - home_object
// - key
CallRuntimeWithOperands(Runtime::kLoadKeyedFromSuper);
PrepareForBailoutForId(prop->LoadId(), TOS_REG);
// Replace home_object with target function.
__ StoreP(r2, MemOperand(sp, kPointerSize));
......
......@@ -2317,6 +2317,7 @@ void FullCodeGenerator::EmitSuperCallWithLoadIC(Call* expr) {
// - home_object
// - key
CallRuntimeWithOperands(Runtime::kLoadFromSuper);
PrepareForBailoutForId(prop->LoadId(), TOS_REG);
// Replace home_object with target function.
__ movp(Operand(rsp, kPointerSize), rax);
......@@ -2374,6 +2375,7 @@ void FullCodeGenerator::EmitKeyedSuperCallWithLoadIC(Call* expr) {
// - home_object
// - key
CallRuntimeWithOperands(Runtime::kLoadKeyedFromSuper);
PrepareForBailoutForId(prop->LoadId(), TOS_REG);
// Replace home_object with target function.
__ movp(Operand(rsp, kPointerSize), rax);
......
......@@ -2321,6 +2321,7 @@ void FullCodeGenerator::EmitSuperCallWithLoadIC(Call* expr) {
// - home_object
// - key
CallRuntimeWithOperands(Runtime::kLoadFromSuper);
PrepareForBailoutForId(prop->LoadId(), TOS_REG);
// Replace home_object with target function.
__ mov(Operand(esp, kPointerSize), eax);
......@@ -2377,6 +2378,7 @@ void FullCodeGenerator::EmitKeyedSuperCallWithLoadIC(Call* expr) {
// - home_object
// - key
CallRuntimeWithOperands(Runtime::kLoadKeyedFromSuper);
PrepareForBailoutForId(prop->LoadId(), TOS_REG);
// Replace home_object with target function.
__ mov(Operand(esp, kPointerSize), eax);
......
// Copyright 2016 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
(function TestDeoptInNamedSuperGetter() {
class C { m() { return 23 } }
class D extends C { f() { return super.boom() } }
var should_deoptimize_caller = false;
Object.defineProperty(C.prototype, "boom", { get: function() {
if (should_deoptimize_caller) %DeoptimizeFunction(D.prototype.f);
return this.m
}})
assertEquals(23, new D().f());
assertEquals(23, new D().f());
%OptimizeFunctionOnNextCall(D.prototype.f);
assertEquals(23, new D().f());
should_deoptimize_caller = true;
assertEquals(23, new D().f());
})();
(function TestDeoptInKeyedSuperGetter() {
class C { m() { return 23 } }
class D extends C { f(name) { return super[name]() } }
var should_deoptimize_caller = false;
Object.defineProperty(C.prototype, "boom", { get: function() {
if (should_deoptimize_caller) %DeoptimizeFunction(D.prototype.f);
return this.m
}})
assertEquals(23, new D().f("boom"));
assertEquals(23, new D().f("boom"));
%OptimizeFunctionOnNextCall(D.prototype.f);
assertEquals(23, new D().f("boom"));
should_deoptimize_caller = true;
assertEquals(23, new D().f("boom"));
})();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment