summaryrefslogtreecommitdiff
path: root/deps
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2019-10-09 11:18:25 +0200
committerMichaël Zasso <targos@protonmail.com>2019-10-11 11:41:02 +0200
commit6b962ddf01f404a51deed683b3a88ea19276107c (patch)
tree9c8575f058e579fc0636aa5a792b3f8e49c1b75b /deps
parent81bc7b3ba5a37a5ad4de0f8798eb42e631d55617 (diff)
downloadandroid-node-v8-6b962ddf01f404a51deed683b3a88ea19276107c.tar.gz
android-node-v8-6b962ddf01f404a51deed683b3a88ea19276107c.tar.bz2
android-node-v8-6b962ddf01f404a51deed683b3a88ea19276107c.zip
deps: patch V8 to 7.8.279.15
Refs: https://github.com/v8/v8/compare/7.8.279.14...7.8.279.15 PR-URL: https://github.com/nodejs/node/pull/29899 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Diffstat (limited to 'deps')
-rw-r--r--deps/v8/include/v8-version.h2
-rw-r--r--deps/v8/src/ast/scopes.cc1
-rw-r--r--deps/v8/src/parsing/expression-scope.h8
-rw-r--r--deps/v8/src/parsing/parser-base.h45
-rw-r--r--deps/v8/src/parsing/parser.cc19
-rw-r--r--deps/v8/src/parsing/parser.h3
-rw-r--r--deps/v8/src/parsing/preparser.h10
-rw-r--r--deps/v8/test/mjsunit/regress/regress-crbug-1009728.js15
-rw-r--r--deps/v8/test/mjsunit/regress/regress-crbug-1011596-module.mjs8
-rw-r--r--deps/v8/test/mjsunit/regress/regress-crbug-1011596.mjs5
10 files changed, 75 insertions, 41 deletions
diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h
index 09afd6248c..000be3a739 100644
--- a/deps/v8/include/v8-version.h
+++ b/deps/v8/include/v8-version.h
@@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 7
#define V8_MINOR_VERSION 8
#define V8_BUILD_NUMBER 279
-#define V8_PATCH_LEVEL 14
+#define V8_PATCH_LEVEL 15
// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
diff --git a/deps/v8/src/ast/scopes.cc b/deps/v8/src/ast/scopes.cc
index c4d0999978..c8002dd088 100644
--- a/deps/v8/src/ast/scopes.cc
+++ b/deps/v8/src/ast/scopes.cc
@@ -1396,6 +1396,7 @@ void Scope::AnalyzePartially(DeclarationScope* max_outer_scope,
for (VariableProxy* proxy = scope->unresolved_list_.first();
proxy != nullptr; proxy = proxy->next_unresolved()) {
+ if (proxy->is_removed_from_unresolved()) continue;
DCHECK(!proxy->is_resolved());
Variable* var =
Lookup<kParsedScope>(proxy, scope, max_outer_scope->outer_scope());
diff --git a/deps/v8/src/parsing/expression-scope.h b/deps/v8/src/parsing/expression-scope.h
index 43bf754150..ba931d36da 100644
--- a/deps/v8/src/parsing/expression-scope.h
+++ b/deps/v8/src/parsing/expression-scope.h
@@ -538,6 +538,10 @@ class ExpressionParsingScope : public ExpressionScope<Types> {
return end;
}
+ ScopedList<std::pair<VariableProxy*, int>>* variable_list() {
+ return &variable_list_;
+ }
+
protected:
bool is_verified() const {
#ifdef DEBUG
@@ -549,10 +553,6 @@ class ExpressionParsingScope : public ExpressionScope<Types> {
void ValidatePattern() { Validate(kPatternIndex); }
- ScopedList<std::pair<VariableProxy*, int>>* variable_list() {
- return &variable_list_;
- }
-
private:
friend class AccumulationScope<Types>;
diff --git a/deps/v8/src/parsing/parser-base.h b/deps/v8/src/parsing/parser-base.h
index f43496b429..1b3bd64cdd 100644
--- a/deps/v8/src/parsing/parser-base.h
+++ b/deps/v8/src/parsing/parser-base.h
@@ -5062,20 +5062,37 @@ ParserBase<Impl>::ParseExpressionOrLabelledStatement(
}
bool starts_with_identifier = peek_any_identifier();
- ExpressionT expr = ParseExpression();
- if (peek() == Token::COLON && starts_with_identifier &&
- impl()->IsIdentifier(expr)) {
- // The whole expression was a single identifier, and not, e.g.,
- // something starting with an identifier or a parenthesized identifier.
- impl()->DeclareLabel(&labels, &own_labels,
- impl()->AsIdentifierExpression(expr));
- Consume(Token::COLON);
- // ES#sec-labelled-function-declarations Labelled Function Declarations
- if (peek() == Token::FUNCTION && is_sloppy(language_mode()) &&
- allow_function == kAllowLabelledFunctionStatement) {
- return ParseFunctionDeclaration();
- }
- return ParseStatement(labels, own_labels, allow_function);
+
+ ExpressionT expr;
+ {
+ // Effectively inlines ParseExpression, so potential labels can be extracted
+ // from expression_scope.
+ ExpressionParsingScope expression_scope(impl());
+ AcceptINScope scope(this, true);
+ expr = ParseExpressionCoverGrammar();
+ expression_scope.ValidateExpression();
+
+ if (peek() == Token::COLON && starts_with_identifier &&
+ impl()->IsIdentifier(expr)) {
+ // The whole expression was a single identifier, and not, e.g.,
+ // something starting with an identifier or a parenthesized identifier.
+ DCHECK_EQ(expression_scope.variable_list()->length(), 1);
+ VariableProxy* label = expression_scope.variable_list()->at(0).first;
+ impl()->DeclareLabel(&labels, &own_labels, label->raw_name());
+
+ // Remove the "ghost" variable that turned out to be a label from the top
+ // scope. This way, we don't try to resolve it during the scope
+ // processing.
+ this->scope()->DeleteUnresolved(label);
+
+ Consume(Token::COLON);
+ // ES#sec-labelled-function-declarations Labelled Function Declarations
+ if (peek() == Token::FUNCTION && is_sloppy(language_mode()) &&
+ allow_function == kAllowLabelledFunctionStatement) {
+ return ParseFunctionDeclaration();
+ }
+ return ParseStatement(labels, own_labels, allow_function);
+ }
}
// If we have an extension, we allow a native function declaration.
diff --git a/deps/v8/src/parsing/parser.cc b/deps/v8/src/parsing/parser.cc
index e1bebc71f0..3a61253db5 100644
--- a/deps/v8/src/parsing/parser.cc
+++ b/deps/v8/src/parsing/parser.cc
@@ -1489,15 +1489,11 @@ Statement* Parser::DeclareNative(const AstRawString* name, int pos) {
void Parser::DeclareLabel(ZonePtrList<const AstRawString>** labels,
ZonePtrList<const AstRawString>** own_labels,
- VariableProxy* var) {
- DCHECK(IsIdentifier(var));
- const AstRawString* label = var->raw_name();
-
- // TODO(1240780): We don't check for redeclaration of labels
- // during preparsing since keeping track of the set of active
- // labels requires nontrivial changes to the way scopes are
- // structured. However, these are probably changes we want to
- // make later anyway so we should go back and fix this then.
+ const AstRawString* label) {
+ // TODO(1240780): We don't check for redeclaration of labels during preparsing
+ // since keeping track of the set of active labels requires nontrivial changes
+ // to the way scopes are structured. However, these are probably changes we
+ // want to make later anyway so we should go back and fix this then.
if (ContainsLabel(*labels, label) || TargetStackContainsLabel(label)) {
ReportMessage(MessageTemplate::kLabelRedeclaration, label);
return;
@@ -1515,11 +1511,6 @@ void Parser::DeclareLabel(ZonePtrList<const AstRawString>** labels,
}
(*labels)->Add(label, zone());
(*own_labels)->Add(label, zone());
-
- // Remove the "ghost" variable that turned out to be a label
- // from the top scope. This way, we don't try to resolve it
- // during the scope processing.
- scope()->DeleteUnresolved(var);
}
bool Parser::ContainsLabel(ZonePtrList<const AstRawString>* labels,
diff --git a/deps/v8/src/parsing/parser.h b/deps/v8/src/parsing/parser.h
index 8170dbb920..2bd555e881 100644
--- a/deps/v8/src/parsing/parser.h
+++ b/deps/v8/src/parsing/parser.h
@@ -8,6 +8,7 @@
#include <cstddef>
#include "src/ast/ast-source-ranges.h"
+#include "src/ast/ast-value-factory.h"
#include "src/ast/ast.h"
#include "src/ast/scopes.h"
#include "src/base/compiler-specific.h"
@@ -273,7 +274,7 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
Statement* BuildInitializationBlock(DeclarationParsingResult* parsing_result);
void DeclareLabel(ZonePtrList<const AstRawString>** labels,
ZonePtrList<const AstRawString>** own_labels,
- VariableProxy* expr);
+ const AstRawString* label);
bool ContainsLabel(ZonePtrList<const AstRawString>* labels,
const AstRawString* label);
Expression* RewriteReturn(Expression* return_value, int pos);
diff --git a/deps/v8/src/parsing/preparser.h b/deps/v8/src/parsing/preparser.h
index d7c2a92dfa..b4d66d726f 100644
--- a/deps/v8/src/parsing/preparser.h
+++ b/deps/v8/src/parsing/preparser.h
@@ -5,6 +5,7 @@
#ifndef V8_PARSING_PREPARSER_H_
#define V8_PARSING_PREPARSER_H_
+#include "src/ast/ast-value-factory.h"
#include "src/ast/ast.h"
#include "src/ast/scopes.h"
#include "src/parsing/parser-base.h"
@@ -1071,9 +1072,8 @@ class PreParser : public ParserBase<PreParser> {
V8_INLINE void DeclareLabel(ZonePtrList<const AstRawString>** labels,
ZonePtrList<const AstRawString>** own_labels,
- const PreParserExpression& expr) {
- DCHECK(!parsing_module_ || !expr.AsIdentifier().IsAwait());
- DCHECK(IsIdentifier(expr));
+ const AstRawString* label) {
+ DCHECK(!parsing_module_ || !label->IsOneByteEqualTo("await"));
}
// TODO(nikolaos): The preparser currently does not keep track of labels.
@@ -1323,10 +1323,6 @@ class PreParser : public ParserBase<PreParser> {
return identifier.IsEvalOrArguments();
}
- V8_INLINE bool IsAwait(const PreParserIdentifier& identifier) const {
- return identifier.IsAwait();
- }
-
// Returns true if the expression is of type "this.foo".
V8_INLINE static bool IsThisProperty(const PreParserExpression& expression) {
return expression.IsThisProperty();
diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-1009728.js b/deps/v8/test/mjsunit/regress/regress-crbug-1009728.js
new file mode 100644
index 0000000000..2632368910
--- /dev/null
+++ b/deps/v8/test/mjsunit/regress/regress-crbug-1009728.js
@@ -0,0 +1,15 @@
+// Copyright 2019 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: --stress-lazy-source-positions
+
+function foo(x) {
+ (function bar() {
+ {
+ x: 1
+ }
+ function f() {}
+ });
+}
+foo();
diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-1011596-module.mjs b/deps/v8/test/mjsunit/regress/regress-crbug-1011596-module.mjs
new file mode 100644
index 0000000000..2ad389f7a0
--- /dev/null
+++ b/deps/v8/test/mjsunit/regress/regress-crbug-1011596-module.mjs
@@ -0,0 +1,8 @@
+// Copyright 2019 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.
+
+export function foo() {
+ { label: 1 }
+ return 42;
+}
diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-1011596.mjs b/deps/v8/test/mjsunit/regress/regress-crbug-1011596.mjs
new file mode 100644
index 0000000000..c223a3a1b5
--- /dev/null
+++ b/deps/v8/test/mjsunit/regress/regress-crbug-1011596.mjs
@@ -0,0 +1,5 @@
+// Copyright 2019 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.
+
+import "./regress-crbug-1011596-module.mjs"