Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(725)

Unified Diff: src/parsing/parser.h

Issue 2654423004: [async-functions] support await expressions in finally statements (Closed)
Patch Set: I'd like to build with -Wunused-variables locally, but how!? Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | src/parsing/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.h
diff --git a/src/parsing/parser.h b/src/parsing/parser.h
index af4aa1013ac7c5dc165a5417a41907bd96621b45..498eac0a8c9dd398ac5fda41901926b40386cdb6 100644
--- a/src/parsing/parser.h
+++ b/src/parsing/parser.h
@@ -344,10 +344,9 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
void ParseAndRewriteGeneratorFunctionBody(int pos, FunctionKind kind,
ZoneList<Statement*>* body,
bool* ok);
- void CreateFunctionNameAssignment(const AstRawString* function_name, int pos,
- FunctionLiteral::FunctionType function_type,
- DeclarationScope* function_scope,
- ZoneList<Statement*>* result, int index);
+ void CreateFunctionNameVariable(const AstRawString* function_name, int pos,
+ FunctionLiteral::FunctionType function_type,
+ DeclarationScope* function_scope);
Statement* DeclareFunction(const AstRawString* variable_name,
FunctionLiteral* function, VariableMode mode,
@@ -542,14 +541,14 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
Block* BuildParameterInitializationBlock(
const ParserFormalParameters& parameters, bool* ok);
- Block* BuildRejectPromiseOnException(Block* block);
ZoneList<Statement*>* ParseFunction(
const AstRawString* function_name, int pos, FunctionKind kind,
FunctionLiteral::FunctionType function_type,
DeclarationScope* function_scope, int* num_parameters,
- int* function_length, bool* has_duplicate_parameters,
- int* materialized_literal_count, int* expected_property_count, bool* ok);
+ Block** parameter_init_block, int* function_length,
+ bool* has_duplicate_parameters, int* materialized_literal_count,
+ int* expected_property_count, bool* ok);
void ThrowPendingError(Isolate* isolate, Handle<Script> script);
@@ -628,9 +627,6 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
Expression* BuildInitialYield(int pos, FunctionKind kind);
Assignment* BuildCreateJSGeneratorObject(int pos, FunctionKind kind);
- Expression* BuildResolvePromise(Expression* value, int pos);
- Expression* BuildRejectPromise(Expression* value, int pos);
- Variable* PromiseVariable();
// Generic AST generator for throwing errors from compiled code.
Expression* NewThrowError(Runtime::FunctionId function_id,
@@ -651,15 +647,14 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
Expression* completion);
Statement* CheckCallable(Variable* var, Expression* error, int pos);
- V8_INLINE Expression* RewriteAwaitExpression(Expression* value, int pos);
+ // V8_INLINE Expression* RewriteAwaitExpression(Expression* value, int pos);
V8_INLINE void PrepareAsyncFunctionBody(ZoneList<Statement*>* body,
FunctionKind kind, int pos);
V8_INLINE void RewriteAsyncFunctionBody(ZoneList<Statement*>* body,
Block* block,
Expression* return_value, bool* ok);
- Expression* RewriteYieldStar(Expression* generator, Expression* expression,
- int pos);
+ Expression* RewriteYieldStar(Expression* expression, int pos);
void AddArrowFunctionFormalParameters(ParserFormalParameters* parameters,
Expression* params, int end_pos,
@@ -1021,18 +1016,6 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
factory()->NewThrow(exception, pos), pos);
}
- V8_INLINE void AddParameterInitializationBlock(
- const ParserFormalParameters& parameters, ZoneList<Statement*>* body,
- bool is_async, bool* ok) {
- if (parameters.is_simple) return;
- auto* init_block = BuildParameterInitializationBlock(parameters, ok);
- if (!*ok) return;
- if (is_async) {
- init_block = BuildRejectPromiseOnException(init_block);
- }
- if (init_block != nullptr) body->Add(init_block, zone());
- }
-
V8_INLINE void AddFormalParameter(ParserFormalParameters* parameters,
Expression* pattern,
Expression* initializer,
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698