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

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

Issue 2861983002: [ignition] Optimize JSGenerator creation (Closed)
Patch Set: rebase Created 3 years, 7 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
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 <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 9
10 #include "src/api.h" 10 #include "src/api.h"
(...skipping 3127 matching lines...) Expand 10 before | Expand all | Expand 10 after
3138 } 3138 }
3139 3139
3140 Statement* try_finally_statement = factory()->NewTryFinallyStatement( 3140 Statement* try_finally_statement = factory()->NewTryFinallyStatement(
3141 outer_try_block, finally_block, kNoSourcePosition); 3141 outer_try_block, finally_block, kNoSourcePosition);
3142 3142
3143 result->statements()->Add(try_finally_statement, zone()); 3143 result->statements()->Add(try_finally_statement, zone());
3144 return result; 3144 return result;
3145 } 3145 }
3146 3146
3147 Assignment* Parser::BuildCreateJSGeneratorObject(int pos, FunctionKind kind) { 3147 Assignment* Parser::BuildCreateJSGeneratorObject(int pos, FunctionKind kind) {
3148 // .generator = %CreateJSGeneratorObject(...); 3148 // .generator = %_CreateJSGeneratorObject(...);
3149 DCHECK_NOT_NULL(function_state_->generator_object_variable()); 3149 DCHECK_NOT_NULL(function_state_->generator_object_variable());
3150 ZoneList<Expression*>* args = new (zone()) ZoneList<Expression*>(2, zone()); 3150 ZoneList<Expression*>* args = new (zone()) ZoneList<Expression*>(2, zone());
3151 args->Add(factory()->NewThisFunction(pos), zone()); 3151 args->Add(factory()->NewThisFunction(pos), zone());
3152 args->Add(IsArrowFunction(kind) ? GetLiteralUndefined(pos) 3152 args->Add(IsArrowFunction(kind) ? GetLiteralUndefined(pos)
3153 : ThisExpression(kNoSourcePosition), 3153 : ThisExpression(kNoSourcePosition),
3154 zone()); 3154 zone());
3155 Expression* allocation = 3155 Expression* allocation = factory()->NewCallRuntime(
3156 factory()->NewCallRuntime(Runtime::kCreateJSGeneratorObject, args, pos); 3156 Runtime::kInlineCreateJSGeneratorObject, args, pos);
3157 VariableProxy* proxy = 3157 VariableProxy* proxy =
3158 factory()->NewVariableProxy(function_state_->generator_object_variable()); 3158 factory()->NewVariableProxy(function_state_->generator_object_variable());
3159 return factory()->NewAssignment(Token::INIT, proxy, allocation, 3159 return factory()->NewAssignment(Token::INIT, proxy, allocation,
3160 kNoSourcePosition); 3160 kNoSourcePosition);
3161 } 3161 }
3162 3162
3163 Expression* Parser::BuildResolvePromise(Expression* value, int pos) { 3163 Expression* Parser::BuildResolvePromise(Expression* value, int pos) {
3164 // %ResolvePromise(.promise, value), .promise 3164 // %ResolvePromise(.promise, value), .promise
3165 ZoneList<Expression*>* args = new (zone()) ZoneList<Expression*>(2, zone()); 3165 ZoneList<Expression*>* args = new (zone()) ZoneList<Expression*>(2, zone());
3166 args->Add(factory()->NewVariableProxy(PromiseVariable()), zone()); 3166 args->Add(factory()->NewVariableProxy(PromiseVariable()), zone());
(...skipping 2065 matching lines...) Expand 10 before | Expand all | Expand 10 after
5232 literal->SetShouldEagerCompile(); 5232 literal->SetShouldEagerCompile();
5233 } 5233 }
5234 } 5234 }
5235 5235
5236 #undef CHECK_OK 5236 #undef CHECK_OK
5237 #undef CHECK_OK_VOID 5237 #undef CHECK_OK_VOID
5238 #undef CHECK_FAILED 5238 #undef CHECK_FAILED
5239 5239
5240 } // namespace internal 5240 } // namespace internal
5241 } // namespace v8 5241 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/interpreter-intrinsics-generator.cc ('k') | test/cctest/interpreter/bytecode_expectations/ForAwaitOf.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698