Skip to content

Commit 6b962dd

Browse files
committed
deps: patch V8 to 7.8.279.15
Refs: v8/v8@7.8.279.14...7.8.279.15 PR-URL: #29899 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Jiawen Geng <[email protected]>
1 parent 81bc7b3 commit 6b962dd

10 files changed

+75
-41
lines changed

deps/v8/include/v8-version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 7
1212
#define V8_MINOR_VERSION 8
1313
#define V8_BUILD_NUMBER 279
14-
#define V8_PATCH_LEVEL 14
14+
#define V8_PATCH_LEVEL 15
1515

1616
// Use 1 for candidates and 0 otherwise.
1717
// (Boolean macro values are not supported by all preprocessors.)

deps/v8/src/ast/scopes.cc

+1
Original file line numberDiff line numberDiff line change
@@ -1396,6 +1396,7 @@ void Scope::AnalyzePartially(DeclarationScope* max_outer_scope,
13961396

13971397
for (VariableProxy* proxy = scope->unresolved_list_.first();
13981398
proxy != nullptr; proxy = proxy->next_unresolved()) {
1399+
if (proxy->is_removed_from_unresolved()) continue;
13991400
DCHECK(!proxy->is_resolved());
14001401
Variable* var =
14011402
Lookup<kParsedScope>(proxy, scope, max_outer_scope->outer_scope());

deps/v8/src/parsing/expression-scope.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,10 @@ class ExpressionParsingScope : public ExpressionScope<Types> {
538538
return end;
539539
}
540540

541+
ScopedList<std::pair<VariableProxy*, int>>* variable_list() {
542+
return &variable_list_;
543+
}
544+
541545
protected:
542546
bool is_verified() const {
543547
#ifdef DEBUG
@@ -549,10 +553,6 @@ class ExpressionParsingScope : public ExpressionScope<Types> {
549553

550554
void ValidatePattern() { Validate(kPatternIndex); }
551555

552-
ScopedList<std::pair<VariableProxy*, int>>* variable_list() {
553-
return &variable_list_;
554-
}
555-
556556
private:
557557
friend class AccumulationScope<Types>;
558558

deps/v8/src/parsing/parser-base.h

+31-14
Original file line numberDiff line numberDiff line change
@@ -5062,20 +5062,37 @@ ParserBase<Impl>::ParseExpressionOrLabelledStatement(
50625062
}
50635063

50645064
bool starts_with_identifier = peek_any_identifier();
5065-
ExpressionT expr = ParseExpression();
5066-
if (peek() == Token::COLON && starts_with_identifier &&
5067-
impl()->IsIdentifier(expr)) {
5068-
// The whole expression was a single identifier, and not, e.g.,
5069-
// something starting with an identifier or a parenthesized identifier.
5070-
impl()->DeclareLabel(&labels, &own_labels,
5071-
impl()->AsIdentifierExpression(expr));
5072-
Consume(Token::COLON);
5073-
// ES#sec-labelled-function-declarations Labelled Function Declarations
5074-
if (peek() == Token::FUNCTION && is_sloppy(language_mode()) &&
5075-
allow_function == kAllowLabelledFunctionStatement) {
5076-
return ParseFunctionDeclaration();
5077-
}
5078-
return ParseStatement(labels, own_labels, allow_function);
5065+
5066+
ExpressionT expr;
5067+
{
5068+
// Effectively inlines ParseExpression, so potential labels can be extracted
5069+
// from expression_scope.
5070+
ExpressionParsingScope expression_scope(impl());
5071+
AcceptINScope scope(this, true);
5072+
expr = ParseExpressionCoverGrammar();
5073+
expression_scope.ValidateExpression();
5074+
5075+
if (peek() == Token::COLON && starts_with_identifier &&
5076+
impl()->IsIdentifier(expr)) {
5077+
// The whole expression was a single identifier, and not, e.g.,
5078+
// something starting with an identifier or a parenthesized identifier.
5079+
DCHECK_EQ(expression_scope.variable_list()->length(), 1);
5080+
VariableProxy* label = expression_scope.variable_list()->at(0).first;
5081+
impl()->DeclareLabel(&labels, &own_labels, label->raw_name());
5082+
5083+
// Remove the "ghost" variable that turned out to be a label from the top
5084+
// scope. This way, we don't try to resolve it during the scope
5085+
// processing.
5086+
this->scope()->DeleteUnresolved(label);
5087+
5088+
Consume(Token::COLON);
5089+
// ES#sec-labelled-function-declarations Labelled Function Declarations
5090+
if (peek() == Token::FUNCTION && is_sloppy(language_mode()) &&
5091+
allow_function == kAllowLabelledFunctionStatement) {
5092+
return ParseFunctionDeclaration();
5093+
}
5094+
return ParseStatement(labels, own_labels, allow_function);
5095+
}
50795096
}
50805097

50815098
// If we have an extension, we allow a native function declaration.

deps/v8/src/parsing/parser.cc

+5-14
Original file line numberDiff line numberDiff line change
@@ -1489,15 +1489,11 @@ Statement* Parser::DeclareNative(const AstRawString* name, int pos) {
14891489

14901490
void Parser::DeclareLabel(ZonePtrList<const AstRawString>** labels,
14911491
ZonePtrList<const AstRawString>** own_labels,
1492-
VariableProxy* var) {
1493-
DCHECK(IsIdentifier(var));
1494-
const AstRawString* label = var->raw_name();
1495-
1496-
// TODO(1240780): We don't check for redeclaration of labels
1497-
// during preparsing since keeping track of the set of active
1498-
// labels requires nontrivial changes to the way scopes are
1499-
// structured. However, these are probably changes we want to
1500-
// make later anyway so we should go back and fix this then.
1492+
const AstRawString* label) {
1493+
// TODO(1240780): We don't check for redeclaration of labels during preparsing
1494+
// since keeping track of the set of active labels requires nontrivial changes
1495+
// to the way scopes are structured. However, these are probably changes we
1496+
// want to make later anyway so we should go back and fix this then.
15011497
if (ContainsLabel(*labels, label) || TargetStackContainsLabel(label)) {
15021498
ReportMessage(MessageTemplate::kLabelRedeclaration, label);
15031499
return;
@@ -1515,11 +1511,6 @@ void Parser::DeclareLabel(ZonePtrList<const AstRawString>** labels,
15151511
}
15161512
(*labels)->Add(label, zone());
15171513
(*own_labels)->Add(label, zone());
1518-
1519-
// Remove the "ghost" variable that turned out to be a label
1520-
// from the top scope. This way, we don't try to resolve it
1521-
// during the scope processing.
1522-
scope()->DeleteUnresolved(var);
15231514
}
15241515

15251516
bool Parser::ContainsLabel(ZonePtrList<const AstRawString>* labels,

deps/v8/src/parsing/parser.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <cstddef>
99

1010
#include "src/ast/ast-source-ranges.h"
11+
#include "src/ast/ast-value-factory.h"
1112
#include "src/ast/ast.h"
1213
#include "src/ast/scopes.h"
1314
#include "src/base/compiler-specific.h"
@@ -273,7 +274,7 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
273274
Statement* BuildInitializationBlock(DeclarationParsingResult* parsing_result);
274275
void DeclareLabel(ZonePtrList<const AstRawString>** labels,
275276
ZonePtrList<const AstRawString>** own_labels,
276-
VariableProxy* expr);
277+
const AstRawString* label);
277278
bool ContainsLabel(ZonePtrList<const AstRawString>* labels,
278279
const AstRawString* label);
279280
Expression* RewriteReturn(Expression* return_value, int pos);

deps/v8/src/parsing/preparser.h

+3-7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#ifndef V8_PARSING_PREPARSER_H_
66
#define V8_PARSING_PREPARSER_H_
77

8+
#include "src/ast/ast-value-factory.h"
89
#include "src/ast/ast.h"
910
#include "src/ast/scopes.h"
1011
#include "src/parsing/parser-base.h"
@@ -1071,9 +1072,8 @@ class PreParser : public ParserBase<PreParser> {
10711072

10721073
V8_INLINE void DeclareLabel(ZonePtrList<const AstRawString>** labels,
10731074
ZonePtrList<const AstRawString>** own_labels,
1074-
const PreParserExpression& expr) {
1075-
DCHECK(!parsing_module_ || !expr.AsIdentifier().IsAwait());
1076-
DCHECK(IsIdentifier(expr));
1075+
const AstRawString* label) {
1076+
DCHECK(!parsing_module_ || !label->IsOneByteEqualTo("await"));
10771077
}
10781078

10791079
// TODO(nikolaos): The preparser currently does not keep track of labels.
@@ -1323,10 +1323,6 @@ class PreParser : public ParserBase<PreParser> {
13231323
return identifier.IsEvalOrArguments();
13241324
}
13251325

1326-
V8_INLINE bool IsAwait(const PreParserIdentifier& identifier) const {
1327-
return identifier.IsAwait();
1328-
}
1329-
13301326
// Returns true if the expression is of type "this.foo".
13311327
V8_INLINE static bool IsThisProperty(const PreParserExpression& expression) {
13321328
return expression.IsThisProperty();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2019 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
// Flags: --stress-lazy-source-positions
6+
7+
function foo(x) {
8+
(function bar() {
9+
{
10+
x: 1
11+
}
12+
function f() {}
13+
});
14+
}
15+
foo();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Copyright 2019 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
export function foo() {
6+
{ label: 1 }
7+
return 42;
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Copyright 2019 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
import "./regress-crbug-1011596-module.mjs"

0 commit comments

Comments
 (0)