From 5f431b72a9cae82ca17e06aed95c40b78e7e6867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Fri, 20 Nov 2015 12:08:27 +0100 Subject: [PATCH] deps: backport 819b40a from V8 upstream Original commit message: Use baseline code to compute message locations. This switches Isolate::ComputeLocation to use baseline code when computing message locations. This unifies locations between optimized and non-optimized code by always going through the FrameSummary for location computation. R=bmeurer@chromium.org TEST=message/regress/regress-4266 BUG=v8:4266 LOG=n Review URL: https://codereview.chromium.org/1331603002 Cr-Commit-Position: refs/heads/master@{#30635} Fixes: https://github.com/nodejs/node/issues/3934 PR-URL: https://github.com/nodejs/node/pull/3938 Reviewed-By: Colin Ihrig Reviewed-By: Fedor Indutny Reviewed-By: Ben Noordhuis --- deps/v8/src/arm/full-codegen-arm.cc | 2 +- deps/v8/src/arm64/full-codegen-arm64.cc | 2 +- deps/v8/src/ast-numbering.cc | 2 +- deps/v8/src/compiler/ast-graph-builder.cc | 3 +-- deps/v8/src/compiler/linkage.cc | 1 + deps/v8/src/ia32/full-codegen-ia32.cc | 2 +- deps/v8/src/isolate.cc | 9 +++++++-- deps/v8/src/mips/full-codegen-mips.cc | 2 +- deps/v8/src/mips64/full-codegen-mips64.cc | 2 +- deps/v8/src/ppc/full-codegen-ppc.cc | 2 +- deps/v8/src/scopes.cc | 4 ++-- deps/v8/src/scopes.h | 4 ++-- deps/v8/src/x64/full-codegen-x64.cc | 2 +- deps/v8/src/x87/full-codegen-x87.cc | 2 +- deps/v8/test/message/regress/regress-4266.js | 11 +++++++++++ deps/v8/test/message/regress/regress-4266.out | 10 ++++++++++ deps/v8/test/mjsunit/regress/regress-4266.js | 17 +++++++++++++++++ 17 files changed, 60 insertions(+), 17 deletions(-) create mode 100644 deps/v8/test/message/regress/regress-4266.js create mode 100644 deps/v8/test/message/regress/regress-4266.out create mode 100644 deps/v8/test/mjsunit/regress/regress-4266.js diff --git a/deps/v8/src/arm/full-codegen-arm.cc b/deps/v8/src/arm/full-codegen-arm.cc index e4b7cf34ee461d..f22bd20ebf85f2 100644 --- a/deps/v8/src/arm/full-codegen-arm.cc +++ b/deps/v8/src/arm/full-codegen-arm.cc @@ -340,7 +340,7 @@ void FullCodeGenerator::Generate() { // redeclaration. if (scope()->HasIllegalRedeclaration()) { Comment cmnt(masm_, "[ Declarations"); - scope()->VisitIllegalRedeclaration(this); + VisitForEffect(scope()->GetIllegalRedeclaration()); } else { PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS); diff --git a/deps/v8/src/arm64/full-codegen-arm64.cc b/deps/v8/src/arm64/full-codegen-arm64.cc index 324bfb8160158e..d4984701c93322 100644 --- a/deps/v8/src/arm64/full-codegen-arm64.cc +++ b/deps/v8/src/arm64/full-codegen-arm64.cc @@ -345,7 +345,7 @@ void FullCodeGenerator::Generate() { // redeclaration. if (scope()->HasIllegalRedeclaration()) { Comment cmnt(masm_, "[ Declarations"); - scope()->VisitIllegalRedeclaration(this); + VisitForEffect(scope()->GetIllegalRedeclaration()); } else { PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS); diff --git a/deps/v8/src/ast-numbering.cc b/deps/v8/src/ast-numbering.cc index 151cc8abc10b23..93bdb690856f57 100644 --- a/deps/v8/src/ast-numbering.cc +++ b/deps/v8/src/ast-numbering.cc @@ -530,7 +530,7 @@ bool AstNumberingVisitor::Renumber(FunctionLiteral* node) { Scope* scope = node->scope(); if (scope->HasIllegalRedeclaration()) { - scope->VisitIllegalRedeclaration(this); + Visit(scope->GetIllegalRedeclaration()); DisableOptimization(kFunctionWithIllegalRedeclaration); return Finish(node); } diff --git a/deps/v8/src/compiler/ast-graph-builder.cc b/deps/v8/src/compiler/ast-graph-builder.cc index 341aedc09910e3..4ee0f5dcc50eae 100644 --- a/deps/v8/src/compiler/ast-graph-builder.cc +++ b/deps/v8/src/compiler/ast-graph-builder.cc @@ -579,8 +579,7 @@ void AstGraphBuilder::CreateGraphBody(bool stack_check) { // Visit illegal re-declaration and bail out if it exists. if (scope->HasIllegalRedeclaration()) { - AstEffectContext for_effect(this); - scope->VisitIllegalRedeclaration(this); + VisitForEffect(scope->GetIllegalRedeclaration()); return; } diff --git a/deps/v8/src/compiler/linkage.cc b/deps/v8/src/compiler/linkage.cc index 6ef014246d95f7..c7835dd73e5707 100644 --- a/deps/v8/src/compiler/linkage.cc +++ b/deps/v8/src/compiler/linkage.cc @@ -194,6 +194,7 @@ int Linkage::FrameStateInputCount(Runtime::FunctionId function) { case Runtime::kInlineGetCallerJSFunction: case Runtime::kInlineGetPrototype: case Runtime::kInlineRegExpExec: + case Runtime::kInlineSubString: return 1; case Runtime::kInlineDeoptimizeNow: case Runtime::kInlineThrowNotDateError: diff --git a/deps/v8/src/ia32/full-codegen-ia32.cc b/deps/v8/src/ia32/full-codegen-ia32.cc index 535f2c2c63e7b6..b074a96f8c0b9c 100644 --- a/deps/v8/src/ia32/full-codegen-ia32.cc +++ b/deps/v8/src/ia32/full-codegen-ia32.cc @@ -342,7 +342,7 @@ void FullCodeGenerator::Generate() { // redeclaration. if (scope()->HasIllegalRedeclaration()) { Comment cmnt(masm_, "[ Declarations"); - scope()->VisitIllegalRedeclaration(this); + VisitForEffect(scope()->GetIllegalRedeclaration()); } else { PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS); diff --git a/deps/v8/src/isolate.cc b/deps/v8/src/isolate.cc index 2c83faac4fba24..186a4935823ae6 100644 --- a/deps/v8/src/isolate.cc +++ b/deps/v8/src/isolate.cc @@ -1279,9 +1279,14 @@ void Isolate::ComputeLocation(MessageLocation* target) { Object* script = fun->shared()->script(); if (script->IsScript() && !(Script::cast(script)->source()->IsUndefined())) { - int pos = frame->LookupCode()->SourcePosition(frame->pc()); - // Compute the location from the function and the reloc info. Handle