Commit 5d66a7f7 authored by ishell's avatar ishell Committed by Commit bot

[fullcode] Restore context after calling ToNumber builtin.

BUG=chromium:628573

Review-Url: https://codereview.chromium.org/2153783002
Cr-Commit-Position: refs/heads/master@{#37796}
parent feb93dd6
......@@ -3291,6 +3291,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
// Convert old value into a number.
__ Call(isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET);
RestoreContext();
PrepareForBailoutForId(expr->ToNumberId(), BailoutState::TOS_REGISTER);
// Save result for postfix expressions.
......
......@@ -3208,6 +3208,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
// Convert old value into a number.
__ Call(isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET);
RestoreContext();
PrepareForBailoutForId(expr->ToNumberId(), BailoutState::TOS_REGISTER);
// Save result for postfix expressions.
......
......@@ -3187,6 +3187,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
// Convert old value into a number.
__ Call(isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET);
RestoreContext();
PrepareForBailoutForId(expr->ToNumberId(), BailoutState::TOS_REGISTER);
// Save result for postfix expressions.
......
......@@ -3297,6 +3297,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
// Convert old value into a number.
__ Call(isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET);
RestoreContext();
PrepareForBailoutForId(expr->ToNumberId(), BailoutState::TOS_REGISTER);
// Save result for postfix expressions.
......
......@@ -3297,6 +3297,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
// Convert old value into a number.
__ Call(isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET);
RestoreContext();
PrepareForBailoutForId(expr->ToNumberId(), BailoutState::TOS_REGISTER);
// Save result for postfix expressions.
......
......@@ -3285,6 +3285,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
// Convert old value into a number.
__ Call(isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET);
RestoreContext();
PrepareForBailoutForId(expr->ToNumberId(), BailoutState::TOS_REGISTER);
// Save result for postfix expressions.
......
......@@ -3206,6 +3206,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
// Convert old value into a number.
__ Call(isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET);
RestoreContext();
PrepareForBailoutForId(expr->ToNumberId(), BailoutState::TOS_REGISTER);
// Save result for postfix expressions.
......
......@@ -3178,6 +3178,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
// Convert old value into a number.
__ Call(isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET);
RestoreContext();
PrepareForBailoutForId(expr->ToNumberId(), BailoutState::TOS_REGISTER);
// Save result for postfix expressions.
......
......@@ -3179,6 +3179,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
// Convert old value into a number.
__ Call(isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET);
RestoreContext();
PrepareForBailoutForId(expr->ToNumberId(), BailoutState::TOS_REGISTER);
// Save result for postfix expressions.
......
// 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
var z = {valueOf: function() { return 3; }};
(function() {
try {
var tmp = { x: 12 };
with (tmp) {
z++;
}
throw new Error("boom");
} catch(e) {}
})();
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