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

Fix clobbered register when setting this_function variable.

R=arv@chromium.org
TEST=mjsunit/regress/regress-crbug-498022
BUG=chromium:498022
LOG=N

Review URL: https://codereview.chromium.org/1185703002

Cr-Commit-Position: refs/heads/master@{#29020}
parent ed977c97
......@@ -243,6 +243,10 @@ void FullCodeGenerator::Generate() {
Variable* this_function_var = scope()->this_function_var();
if (this_function_var != nullptr) {
Comment cmnt(masm_, "[ This function");
if (!function_in_register) {
__ ldr(r1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
function_in_register = true;
}
SetVar(this_function_var, r1, r0, r2);
}
......
......@@ -244,6 +244,10 @@ void FullCodeGenerator::Generate() {
Variable* this_function_var = scope()->this_function_var();
if (this_function_var != nullptr) {
Comment cmnt(masm_, "[ This function");
if (!function_in_register_x1) {
__ Ldr(x1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
function_in_register_x1 = true;
}
SetVar(this_function_var, x1, x0, x2);
}
......
......@@ -239,6 +239,10 @@ void FullCodeGenerator::Generate() {
Variable* this_function_var = scope()->this_function_var();
if (this_function_var != nullptr) {
Comment cmnt(masm_, "[ This function");
if (!function_in_register) {
__ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
function_in_register = true;
}
SetVar(this_function_var, edi, ebx, edx);
}
......
......@@ -252,6 +252,10 @@ void FullCodeGenerator::Generate() {
Variable* this_function_var = scope()->this_function_var();
if (this_function_var != nullptr) {
Comment cmnt(masm_, "[ This function");
if (!function_in_register) {
__ lw(a1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
function_in_register = true;
}
SetVar(this_function_var, a1, a2, a3);
}
......
......@@ -249,6 +249,10 @@ void FullCodeGenerator::Generate() {
Variable* this_function_var = scope()->this_function_var();
if (this_function_var != nullptr) {
Comment cmnt(masm_, "[ This function");
if (!function_in_register) {
__ ld(a1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
function_in_register = true;
}
SetVar(this_function_var, a1, a2, a3);
}
......
......@@ -248,6 +248,10 @@ void FullCodeGenerator::Generate() {
Variable* this_function_var = scope()->this_function_var();
if (this_function_var != nullptr) {
Comment cmnt(masm_, "[ This function");
if (!function_in_register) {
__ LoadP(r4, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
function_in_register = true;
}
SetVar(this_function_var, r4, r3, r5);
}
......
......@@ -235,6 +235,10 @@ void FullCodeGenerator::Generate() {
Variable* this_function_var = scope()->this_function_var();
if (this_function_var != nullptr) {
Comment cmnt(masm_, "[ This function");
if (!function_in_register) {
__ movp(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
function_in_register = true;
}
SetVar(this_function_var, rdi, rbx, rdx);
}
......
......@@ -236,6 +236,10 @@ void FullCodeGenerator::Generate() {
Variable* this_function_var = scope()->this_function_var();
if (this_function_var != nullptr) {
Comment cmnt(masm_, "[ This function");
if (!function_in_register) {
__ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
function_in_register = true;
}
SetVar(this_function_var, edi, ebx, edx);
}
......
// 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: --debug-code --nouse-gvn
"use strict";
class Base {
}
class Derived extends Base {
constructor() {
eval();
}
}
assertThrows("new Derived()", ReferenceError);
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