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

Side by Side Diff: src/parsing/parser.cc

Issue 2693313002: [ast] Mark temporaries as maybe-assigned by default. (Closed)
Patch Set: Make the powerful variant private. Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « src/ast/scopes.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/parsing/parser.h" 5 #include "src/parsing/parser.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/ast/ast-expression-rewriter.h" 10 #include "src/ast/ast-expression-rewriter.h"
(...skipping 2973 matching lines...) Expand 10 before | Expand all | Expand 10 after
2984 // } 2984 // }
2985 Block* result = factory()->NewBlock(nullptr, 2, true, kNoSourcePosition); 2985 Block* result = factory()->NewBlock(nullptr, 2, true, kNoSourcePosition);
2986 2986
2987 // .promise = %AsyncFunctionPromiseCreate(); 2987 // .promise = %AsyncFunctionPromiseCreate();
2988 Statement* set_promise; 2988 Statement* set_promise;
2989 { 2989 {
2990 Expression* create_promise = factory()->NewCallRuntime( 2990 Expression* create_promise = factory()->NewCallRuntime(
2991 Context::ASYNC_FUNCTION_PROMISE_CREATE_INDEX, 2991 Context::ASYNC_FUNCTION_PROMISE_CREATE_INDEX,
2992 new (zone()) ZoneList<Expression*>(0, zone()), kNoSourcePosition); 2992 new (zone()) ZoneList<Expression*>(0, zone()), kNoSourcePosition);
2993 Assignment* assign_promise = factory()->NewAssignment( 2993 Assignment* assign_promise = factory()->NewAssignment(
2994 Token::INIT, factory()->NewVariableProxy(PromiseVariable()), 2994 Token::ASSIGN, factory()->NewVariableProxy(PromiseVariable()),
2995 create_promise, kNoSourcePosition); 2995 create_promise, kNoSourcePosition);
2996 set_promise = 2996 set_promise =
2997 factory()->NewExpressionStatement(assign_promise, kNoSourcePosition); 2997 factory()->NewExpressionStatement(assign_promise, kNoSourcePosition);
2998 } 2998 }
2999 result->statements()->Add(set_promise, zone()); 2999 result->statements()->Add(set_promise, zone());
3000 3000
3001 // catch (.catch) { return %RejectPromise(.promise, .catch), .promise } 3001 // catch (.catch) { return %RejectPromise(.promise, .catch), .promise }
3002 Scope* catch_scope = NewScope(CATCH_SCOPE); 3002 Scope* catch_scope = NewScope(CATCH_SCOPE);
3003 catch_scope->set_is_hidden(); 3003 catch_scope->set_is_hidden();
3004 Variable* catch_variable = 3004 Variable* catch_variable =
(...skipping 2013 matching lines...) Expand 10 before | Expand all | Expand 10 after
5018 5018
5019 return final_loop; 5019 return final_loop;
5020 } 5020 }
5021 5021
5022 #undef CHECK_OK 5022 #undef CHECK_OK
5023 #undef CHECK_OK_VOID 5023 #undef CHECK_OK_VOID
5024 #undef CHECK_FAILED 5024 #undef CHECK_FAILED
5025 5025
5026 } // namespace internal 5026 } // namespace internal
5027 } // namespace v8 5027 } // namespace v8
OLDNEW
« no previous file with comments | « src/ast/scopes.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698