Skip to content

Commit 5f431b7

Browse files
targosrvagg
authored andcommitted
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. [email protected] 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: #3934 PR-URL: #3938 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent ec5c8d7 commit 5f431b7

17 files changed

+60
-17
lines changed

deps/v8/src/arm/full-codegen-arm.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ void FullCodeGenerator::Generate() {
340340
// redeclaration.
341341
if (scope()->HasIllegalRedeclaration()) {
342342
Comment cmnt(masm_, "[ Declarations");
343-
scope()->VisitIllegalRedeclaration(this);
343+
VisitForEffect(scope()->GetIllegalRedeclaration());
344344

345345
} else {
346346
PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS);

deps/v8/src/arm64/full-codegen-arm64.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ void FullCodeGenerator::Generate() {
345345
// redeclaration.
346346
if (scope()->HasIllegalRedeclaration()) {
347347
Comment cmnt(masm_, "[ Declarations");
348-
scope()->VisitIllegalRedeclaration(this);
348+
VisitForEffect(scope()->GetIllegalRedeclaration());
349349

350350
} else {
351351
PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS);

deps/v8/src/ast-numbering.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ bool AstNumberingVisitor::Renumber(FunctionLiteral* node) {
530530
Scope* scope = node->scope();
531531

532532
if (scope->HasIllegalRedeclaration()) {
533-
scope->VisitIllegalRedeclaration(this);
533+
Visit(scope->GetIllegalRedeclaration());
534534
DisableOptimization(kFunctionWithIllegalRedeclaration);
535535
return Finish(node);
536536
}

deps/v8/src/compiler/ast-graph-builder.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,8 +579,7 @@ void AstGraphBuilder::CreateGraphBody(bool stack_check) {
579579

580580
// Visit illegal re-declaration and bail out if it exists.
581581
if (scope->HasIllegalRedeclaration()) {
582-
AstEffectContext for_effect(this);
583-
scope->VisitIllegalRedeclaration(this);
582+
VisitForEffect(scope->GetIllegalRedeclaration());
584583
return;
585584
}
586585

deps/v8/src/compiler/linkage.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ int Linkage::FrameStateInputCount(Runtime::FunctionId function) {
194194
case Runtime::kInlineGetCallerJSFunction:
195195
case Runtime::kInlineGetPrototype:
196196
case Runtime::kInlineRegExpExec:
197+
case Runtime::kInlineSubString:
197198
return 1;
198199
case Runtime::kInlineDeoptimizeNow:
199200
case Runtime::kInlineThrowNotDateError:

deps/v8/src/ia32/full-codegen-ia32.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ void FullCodeGenerator::Generate() {
342342
// redeclaration.
343343
if (scope()->HasIllegalRedeclaration()) {
344344
Comment cmnt(masm_, "[ Declarations");
345-
scope()->VisitIllegalRedeclaration(this);
345+
VisitForEffect(scope()->GetIllegalRedeclaration());
346346

347347
} else {
348348
PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS);

deps/v8/src/isolate.cc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,9 +1279,14 @@ void Isolate::ComputeLocation(MessageLocation* target) {
12791279
Object* script = fun->shared()->script();
12801280
if (script->IsScript() &&
12811281
!(Script::cast(script)->source()->IsUndefined())) {
1282-
int pos = frame->LookupCode()->SourcePosition(frame->pc());
1283-
// Compute the location from the function and the reloc info.
12841282
Handle<Script> casted_script(Script::cast(script));
1283+
// Compute the location from the function and the relocation info of the
1284+
// baseline code. For optimized code this will use the deoptimization
1285+
// information to get canonical location information.
1286+
List<FrameSummary> frames(FLAG_max_inlining_levels + 1);
1287+
it.frame()->Summarize(&frames);
1288+
FrameSummary& summary = frames.last();
1289+
int pos = summary.code()->SourcePosition(summary.pc());
12851290
*target = MessageLocation(casted_script, pos, pos + 1, handle(fun));
12861291
}
12871292
}

deps/v8/src/mips/full-codegen-mips.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ void FullCodeGenerator::Generate() {
358358
// redeclaration.
359359
if (scope()->HasIllegalRedeclaration()) {
360360
Comment cmnt(masm_, "[ Declarations");
361-
scope()->VisitIllegalRedeclaration(this);
361+
VisitForEffect(scope()->GetIllegalRedeclaration());
362362

363363
} else {
364364
PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS);

deps/v8/src/mips64/full-codegen-mips64.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ void FullCodeGenerator::Generate() {
353353
// redeclaration.
354354
if (scope()->HasIllegalRedeclaration()) {
355355
Comment cmnt(masm_, "[ Declarations");
356-
scope()->VisitIllegalRedeclaration(this);
356+
VisitForEffect(scope()->GetIllegalRedeclaration());
357357

358358
} else {
359359
PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS);

deps/v8/src/ppc/full-codegen-ppc.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ void FullCodeGenerator::Generate() {
351351
// redeclaration.
352352
if (scope()->HasIllegalRedeclaration()) {
353353
Comment cmnt(masm_, "[ Declarations");
354-
scope()->VisitIllegalRedeclaration(this);
354+
VisitForEffect(scope()->GetIllegalRedeclaration());
355355

356356
} else {
357357
PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS);

0 commit comments

Comments
 (0)