Lines Matching refs:factory

111       : ast_node_factory_scope_(parser->factory(), temp_zone, use_temp_zone),  in DiscardableZoneScope()
121 parser_->reusable_preparser_->factory()->set_zone(temp_zone); in DiscardableZoneScope()
130 parser_->reusable_preparser_->factory()->set_zone(prev_zone_); in Reset()
166 VariableProxy* init_fn_proxy = scope->NewUnresolved(factory(), init_fn_name); in CallClassFieldInitializer()
170 return factory()->NewCallRuntime(Runtime::kInlineCall, args, in CallClassFieldInitializer()
189 Block* block = factory()->NewBlock(nullptr, 1, false, kNoSourcePosition); in RewriteSuperCall()
190 Assignment* assignment = factory()->NewAssignment( in RewriteSuperCall()
191 Token::ASSIGN, factory()->NewVariableProxy(var_tmp), super_call, in RewriteSuperCall()
194 factory()->NewExpressionStatement(assignment, kNoSourcePosition), zone()); in RewriteSuperCall()
198 scope()->NewUnresolved(factory(), init_fn_name); in RewriteSuperCall()
200 Statement* initialize = factory()->NewExpressionStatement( in RewriteSuperCall()
201 CallClassFieldInitializer(scope(), factory()->NewVariableProxy(var_tmp)), in RewriteSuperCall()
203 IfStatement* if_statement = factory()->NewIfStatement( in RewriteSuperCall()
204 condition, initialize, factory()->NewEmptyStatement(kNoSourcePosition), in RewriteSuperCall()
207 return factory()->NewDoExpression(block, var_tmp, kNoSourcePosition); in RewriteSuperCall()
254 Expression* super_constructor = factory()->NewCallRuntime( in DefaultConstructor()
257 Spread* spread_args = factory()->NewSpread( in DefaultConstructor()
258 factory()->NewVariableProxy(constructor_args), pos, pos); in DefaultConstructor()
266 Expression* call = factory()->NewCallRuntime( in DefaultConstructor()
271 body->Add(factory()->NewReturnStatement(call, pos), zone()); in DefaultConstructor()
278 FunctionLiteral* function_literal = factory()->NewFunctionLiteral( in DefaultConstructor()
328 *x = factory()->NewNumberLiteral(x_val + y_val, pos, has_dot); in ShortcutNumericLiteralBinaryExpression()
331 *x = factory()->NewNumberLiteral(x_val - y_val, pos, has_dot); in ShortcutNumericLiteralBinaryExpression()
334 *x = factory()->NewNumberLiteral(x_val * y_val, pos, has_dot); in ShortcutNumericLiteralBinaryExpression()
337 *x = factory()->NewNumberLiteral(x_val / y_val, pos, has_dot); in ShortcutNumericLiteralBinaryExpression()
341 *x = factory()->NewNumberLiteral(value, pos, has_dot); in ShortcutNumericLiteralBinaryExpression()
346 *x = factory()->NewNumberLiteral(value, pos, has_dot); in ShortcutNumericLiteralBinaryExpression()
351 *x = factory()->NewNumberLiteral(value, pos, has_dot); in ShortcutNumericLiteralBinaryExpression()
356 *x = factory()->NewNumberLiteral(value, pos, has_dot); in ShortcutNumericLiteralBinaryExpression()
362 *x = factory()->NewNumberLiteral(value, pos, has_dot); in ShortcutNumericLiteralBinaryExpression()
368 *x = factory()->NewNumberLiteral(value, pos, has_dot); in ShortcutNumericLiteralBinaryExpression()
374 *x = factory()->NewNumberLiteral( in ShortcutNumericLiteralBinaryExpression()
394 return factory()->NewBooleanLiteral(!condition, pos); in BuildUnaryExpression()
403 return factory()->NewNumberLiteral(-value, pos, has_dot); in BuildUnaryExpression()
405 return factory()->NewNumberLiteral(~DoubleToInt32(value), pos, in BuildUnaryExpression()
414 return factory()->NewBinaryOperation( in BuildUnaryExpression()
415 Token::MUL, expression, factory()->NewNumberLiteral(1, pos, true), pos); in BuildUnaryExpression()
419 return factory()->NewBinaryOperation( in BuildUnaryExpression()
420 Token::MUL, expression, factory()->NewNumberLiteral(-1, pos), pos); in BuildUnaryExpression()
424 return factory()->NewBinaryOperation( in BuildUnaryExpression()
425 Token::BIT_XOR, expression, factory()->NewNumberLiteral(~0, pos), pos); in BuildUnaryExpression()
427 return factory()->NewUnaryOperation(op, expression, pos); in BuildUnaryExpression()
433 if (value == nullptr) value = factory()->NewUndefinedLiteral(pos); in BuildIteratorResult()
437 args->Add(factory()->NewBooleanLiteral(done, pos), zone()); in BuildIteratorResult()
439 return factory()->NewCallRuntime(Runtime::kInlineCreateIterResultObject, args, in BuildIteratorResult()
447 args->Add(factory()->NewSmiLiteral(message, pos), zone()); in NewThrowError()
448 args->Add(factory()->NewStringLiteral(arg, pos), zone()); in NewThrowError()
449 CallRuntime* call_constructor = factory()->NewCallRuntime(id, args, pos); in NewThrowError()
450 return factory()->NewThrow(call_constructor, pos); in NewThrowError()
458 factory()->NewSymbolLiteral("home_object_symbol", kNoSourcePosition); in NewSuperPropertyReference()
459 Expression* home_object = factory()->NewProperty( in NewSuperPropertyReference()
461 return factory()->NewSuperPropertyReference( in NewSuperPropertyReference()
470 return factory()->NewSuperCallReference( in NewSuperCallReference()
485 factory()->NewVariableProxy(function_state_->generator_object_variable()); in FunctionSentExpression()
487 return factory()->NewCallRuntime(Runtime::kInlineGeneratorGetInputOrDebugPos, in FunctionSentExpression()
494 return factory()->NewNullLiteral(pos); in ExpressionFromLiteral()
496 return factory()->NewBooleanLiteral(true, pos); in ExpressionFromLiteral()
498 return factory()->NewBooleanLiteral(false, pos); in ExpressionFromLiteral()
501 return factory()->NewSmiLiteral(value, pos); in ExpressionFromLiteral()
506 return factory()->NewNumberLiteral(value, pos, has_dot); in ExpressionFromLiteral()
516 factory()->NewSymbolLiteral("iterator_symbol", kNoSourcePosition); in GetIterator()
518 factory()->NewProperty(iterable, iterator_symbol_literal, pos); in GetIterator()
520 return factory()->NewCall(prop, args, pos); in GetIterator()
566 return factory()->NewCallRuntime(function, args, pos); in NewV8Intrinsic()
579 return factory()->NewCallRuntime(context_index, args, pos); in NewV8Intrinsic()
771 factory()->NewExpressionStatement(initial_yield, kNoSourcePosition), in DoParseProgram()
818 result = factory()->NewScriptOrEvalFunctionLiteral( in DoParseProgram()
1025 return factory()->NewEmptyStatement(kNoSourcePosition); in ParseModuleItem()
1317 Assignment* assignment = factory()->NewAssignment( in ParseExportDefault()
1319 result = factory()->NewExpressionStatement(assignment, kNoSourcePosition); in ParseExportDefault()
1360 return factory()->NewEmptyStatement(pos); in ParseExportDeclaration()
1407 return factory()->NewEmptyStatement(pos); in ParseExportDeclaration()
1453 return scope()->NewUnresolved(factory(), name, begin_pos, kind); in NewUnresolved()
1457 return scope()->NewUnresolved(factory(), name, scanner()->location().beg_pos); in NewUnresolved()
1470 VariableProxy* proxy = factory()->NewVariableProxy( in DeclareVariable()
1473 factory()->NewVariableDeclaration(proxy, this->scope(), pos); in DeclareVariable()
1516 Block* result = factory()->NewBlock( in BuildInitializationBlock()
1546 factory()->NewVariableProxy(variable_name, NORMAL_VARIABLE); in DeclareFunction()
1548 factory()->NewFunctionDeclaration(proxy, function, scope(), pos); in DeclareFunction()
1560 factory()->NewSloppyBlockFunctionStatement(scope()); in DeclareFunction()
1565 return factory()->NewEmptyStatement(kNoSourcePosition); in DeclareFunction()
1575 Assignment* assignment = factory()->NewAssignment(Token::INIT, decl->proxy(), in DeclareClass()
1578 factory()->NewExpressionStatement(assignment, kNoSourcePosition); in DeclareClass()
1595 factory()->NewNativeFunctionLiteral(name, extension_, kNoSourcePosition); in DeclareNative()
1596 return factory()->NewExpressionStatement( in DeclareNative()
1597 factory()->NewAssignment(Token::INIT, decl->proxy(), lit, in DeclareNative()
1652 Assignment* assign = factory()->NewAssignment( in RewriteReturn()
1653 Token::ASSIGN, factory()->NewVariableProxy(temp), return_value, pos); in RewriteReturn()
1658 is_spec_object_args->Add(factory()->NewVariableProxy(temp), zone()); in RewriteReturn()
1659 Expression* is_spec_object_call = factory()->NewCallRuntime( in RewriteReturn()
1663 Expression* is_object_conditional = factory()->NewConditional( in RewriteReturn()
1664 is_spec_object_call, factory()->NewVariableProxy(temp), in RewriteReturn()
1665 factory()->NewSmiLiteral(1, pos), pos); in RewriteReturn()
1668 Expression* is_undefined = factory()->NewCompareOperation( in RewriteReturn()
1670 factory()->NewUndefinedLiteral(kNoSourcePosition), pos); in RewriteReturn()
1673 return_value = factory()->NewConditional(is_undefined, ThisExpression(pos), in RewriteReturn()
1686 DoExpression* expr = factory()->NewDoExpression(body, result, pos); in RewriteDoExpression()
1708 Block* switch_block = factory()->NewBlock(NULL, 2, false, kNoSourcePosition); in RewriteSwitchStatement()
1712 Assignment* tag_assign = factory()->NewAssignment( in RewriteSwitchStatement()
1713 Token::ASSIGN, factory()->NewVariableProxy(tag_variable), tag, in RewriteSwitchStatement()
1716 factory()->NewExpressionStatement(tag_assign, kNoSourcePosition); in RewriteSwitchStatement()
1723 factory()->NewExpressionStatement( in RewriteSwitchStatement()
1724 factory()->NewUndefinedLiteral(kNoSourcePosition), kNoSourcePosition), in RewriteSwitchStatement()
1727 Expression* tag_read = factory()->NewVariableProxy(tag_variable); in RewriteSwitchStatement()
1729 Block* cases_block = factory()->NewBlock(NULL, 1, false, kNoSourcePosition); in RewriteSwitchStatement()
1757 factory()->NewVariableProxy(catch_info->variable)); in RewriteCatchPattern()
1760 factory()->NewBlock(nullptr, 8, true, kNoSourcePosition); in RewriteCatchPattern()
1802 statement = factory()->NewTryCatchStatementForPromiseReject( in RewriteTryStatement()
1806 statement = factory()->NewTryCatchStatement( in RewriteTryStatement()
1811 try_block = factory()->NewBlock(nullptr, 1, false, kNoSourcePosition); in RewriteTryStatement()
1825 return factory()->NewTryCatchStatement( in RewriteTryStatement()
1829 return factory()->NewTryFinallyStatement(try_block, finally_block, pos); in RewriteTryStatement()
1837 Expression* next_literal = factory()->NewStringLiteral( in BuildIteratorNextResult()
1840 factory()->NewProperty(iterator, next_literal, kNoSourcePosition); in BuildIteratorNextResult()
1844 factory()->NewCall(next_property, next_arguments, pos); in BuildIteratorNextResult()
1845 Expression* result_proxy = factory()->NewVariableProxy(result); in BuildIteratorNextResult()
1847 factory()->NewAssignment(Token::ASSIGN, result_proxy, next_call, pos); in BuildIteratorNextResult()
1853 Expression* is_spec_object_call = factory()->NewCallRuntime( in BuildIteratorNextResult()
1857 Expression* result_proxy_again = factory()->NewVariableProxy(result); in BuildIteratorNextResult()
1861 Expression* throw_call = factory()->NewCallRuntime( in BuildIteratorNextResult()
1864 return factory()->NewBinaryOperation( in BuildIteratorNextResult()
1866 factory()->NewUnaryOperation(Token::NOT, is_spec_object_call, pos), in BuildIteratorNextResult()
1883 VariableProxy* temp_proxy = factory()->NewVariableProxy(temp); in InitializeForEachStatement()
1885 this, factory()->NewAssignment(Token::ASSIGN, each, temp_proxy, in InitializeForEachStatement()
1888 auto block = factory()->NewBlock(nullptr, 2, false, kNoSourcePosition); in InitializeForEachStatement()
1890 factory()->NewExpressionStatement(assign_each, kNoSourcePosition), in InitializeForEachStatement()
1894 each = factory()->NewVariableProxy(temp); in InitializeForEachStatement()
1925 Block* init_block = factory()->NewBlock( in RewriteForVarInLegacy()
1928 factory()->NewExpressionStatement( in RewriteForVarInLegacy()
1929 factory()->NewAssignment(Token::ASSIGN, single_var, in RewriteForVarInLegacy()
1961 factory()->NewBlock(nullptr, 1, true, kNoSourcePosition); in DesugarBindingInForEachStatement()
1966 decl.initializer = factory()->NewVariableProxy(temp); in DesugarBindingInForEachStatement()
2006 *body_block = factory()->NewBlock(nullptr, 3, false, kNoSourcePosition); in DesugarBindingInForEachStatement()
2008 *each_variable = factory()->NewVariableProxy(temp, for_info->position); in DesugarBindingInForEachStatement()
2017 init_block = factory()->NewBlock(nullptr, 1, false, kNoSourcePosition); in CreateForEachStatementTDZ()
2052 assign_iterator = factory()->NewAssignment( in InitializeForOfStatement()
2053 Token::ASSIGN, factory()->NewVariableProxy(iterator), in InitializeForOfStatement()
2061 Expression* iterator_proxy = factory()->NewVariableProxy(iterator); in InitializeForOfStatement()
2069 Expression* done_literal = factory()->NewStringLiteral( in InitializeForOfStatement()
2071 Expression* result_proxy = factory()->NewVariableProxy(result); in InitializeForOfStatement()
2073 factory()->NewProperty(result_proxy, done_literal, kNoSourcePosition); in InitializeForOfStatement()
2080 factory()->NewStringLiteral(avfactory->value_string(), nopos); in InitializeForOfStatement()
2081 Expression* result_proxy = factory()->NewVariableProxy(result); in InitializeForOfStatement()
2082 result_value = factory()->NewProperty(result_proxy, value_literal, nopos); in InitializeForOfStatement()
2088 Expression* proxy = factory()->NewVariableProxy(completion); in InitializeForOfStatement()
2089 Expression* assignment = factory()->NewAssignment( in InitializeForOfStatement()
2091 factory()->NewSmiLiteral(Parser::kAbruptCompletion, nopos), nopos); in InitializeForOfStatement()
2093 Block* block = factory()->NewBlock(nullptr, 1, true, nopos); in InitializeForOfStatement()
2095 factory()->NewExpressionStatement(assignment, nopos), zone()); in InitializeForOfStatement()
2103 Expression* tmp = factory()->NewVariableProxy(var_tmp); in InitializeForOfStatement()
2105 factory()->NewAssignment(Token::ASSIGN, tmp, result_value, nopos); in InitializeForOfStatement()
2107 Block* block = factory()->NewBlock(nullptr, 2, false, nopos); in InitializeForOfStatement()
2109 factory()->NewExpressionStatement(assignment, nopos), zone()); in InitializeForOfStatement()
2112 result_value = factory()->NewDoExpression(block, var_tmp, nopos); in InitializeForOfStatement()
2119 factory()->NewAssignment(Token::ASSIGN, each, result_value, nopos); in InitializeForOfStatement()
2129 Expression* proxy = factory()->NewVariableProxy(completion); in InitializeForOfStatement()
2130 Expression* assignment = factory()->NewAssignment( in InitializeForOfStatement()
2132 factory()->NewSmiLiteral(Parser::kNormalCompletion, nopos), nopos); in InitializeForOfStatement()
2134 Block* block = factory()->NewBlock(nullptr, 1, true, nopos); in InitializeForOfStatement()
2136 factory()->NewExpressionStatement(assignment, nopos), zone()); in InitializeForOfStatement()
2143 Block* block = factory()->NewBlock(nullptr, 2, false, nopos); in InitializeForOfStatement()
2197 Block* outer_block = factory()->NewBlock( in DesugarLexicalBindingsInForStatement()
2210 VariableProxy* temp_proxy = factory()->NewVariableProxy(temp); in DesugarLexicalBindingsInForStatement()
2211 Assignment* assignment = factory()->NewAssignment(Token::ASSIGN, temp_proxy, in DesugarLexicalBindingsInForStatement()
2214 factory()->NewExpressionStatement(assignment, kNoSourcePosition); in DesugarLexicalBindingsInForStatement()
2223 VariableProxy* first_proxy = factory()->NewVariableProxy(first); in DesugarLexicalBindingsInForStatement()
2224 Expression* const1 = factory()->NewSmiLiteral(1, kNoSourcePosition); in DesugarLexicalBindingsInForStatement()
2225 Assignment* assignment = factory()->NewAssignment( in DesugarLexicalBindingsInForStatement()
2228 factory()->NewExpressionStatement(assignment, kNoSourcePosition); in DesugarLexicalBindingsInForStatement()
2234 factory()->NewExpressionStatement( in DesugarLexicalBindingsInForStatement()
2235 factory()->NewUndefinedLiteral(kNoSourcePosition), kNoSourcePosition), in DesugarLexicalBindingsInForStatement()
2244 factory()->NewForStatement(NULL, kNoSourcePosition); in DesugarLexicalBindingsInForStatement()
2248 Block* inner_block = factory()->NewBlock(NULL, 3, false, kNoSourcePosition); in DesugarLexicalBindingsInForStatement()
2252 Block* ignore_completion_block = factory()->NewBlock( in DesugarLexicalBindingsInForStatement()
2262 VariableProxy* temp_proxy = factory()->NewVariableProxy(temps.at(i)); in DesugarLexicalBindingsInForStatement()
2263 Assignment* assignment = factory()->NewAssignment( in DesugarLexicalBindingsInForStatement()
2266 factory()->NewExpressionStatement(assignment, kNoSourcePosition); in DesugarLexicalBindingsInForStatement()
2278 Expression* const1 = factory()->NewSmiLiteral(1, kNoSourcePosition); in DesugarLexicalBindingsInForStatement()
2279 VariableProxy* first_proxy = factory()->NewVariableProxy(first); in DesugarLexicalBindingsInForStatement()
2280 compare = factory()->NewCompareOperation(Token::EQ, first_proxy, const1, in DesugarLexicalBindingsInForStatement()
2286 VariableProxy* first_proxy = factory()->NewVariableProxy(first); in DesugarLexicalBindingsInForStatement()
2287 Expression* const0 = factory()->NewSmiLiteral(0, kNoSourcePosition); in DesugarLexicalBindingsInForStatement()
2288 Assignment* assignment = factory()->NewAssignment( in DesugarLexicalBindingsInForStatement()
2291 factory()->NewExpressionStatement(assignment, kNoSourcePosition); in DesugarLexicalBindingsInForStatement()
2293 Statement* clear_first_or_next = factory()->NewIfStatement( in DesugarLexicalBindingsInForStatement()
2301 VariableProxy* flag_proxy = factory()->NewVariableProxy(flag); in DesugarLexicalBindingsInForStatement()
2302 Expression* const1 = factory()->NewSmiLiteral(1, kNoSourcePosition); in DesugarLexicalBindingsInForStatement()
2303 Assignment* assignment = factory()->NewAssignment( in DesugarLexicalBindingsInForStatement()
2306 factory()->NewExpressionStatement(assignment, kNoSourcePosition); in DesugarLexicalBindingsInForStatement()
2313 factory()->NewBreakStatement(outer_loop, kNoSourcePosition); in DesugarLexicalBindingsInForStatement()
2314 Statement* noop = factory()->NewEmptyStatement(kNoSourcePosition); in DesugarLexicalBindingsInForStatement()
2316 factory()->NewIfStatement(cond, noop, stop, cond->position()), in DesugarLexicalBindingsInForStatement()
2324 Expression* const1 = factory()->NewSmiLiteral(1, kNoSourcePosition); in DesugarLexicalBindingsInForStatement()
2325 VariableProxy* flag_proxy = factory()->NewVariableProxy(flag); in DesugarLexicalBindingsInForStatement()
2326 flag_cond = factory()->NewCompareOperation(Token::EQ, flag_proxy, const1, in DesugarLexicalBindingsInForStatement()
2336 VariableProxy* flag_proxy = factory()->NewVariableProxy(flag); in DesugarLexicalBindingsInForStatement()
2337 Expression* const0 = factory()->NewSmiLiteral(0, kNoSourcePosition); in DesugarLexicalBindingsInForStatement()
2338 compound_next = factory()->NewAssignment(Token::ASSIGN, flag_proxy, in DesugarLexicalBindingsInForStatement()
2345 VariableProxy* temp_proxy = factory()->NewVariableProxy(temps.at(i)); in DesugarLexicalBindingsInForStatement()
2347 factory()->NewVariableProxy(inner_vars.at(i), inner_var_proxy_pos); in DesugarLexicalBindingsInForStatement()
2348 Assignment* assignment = factory()->NewAssignment( in DesugarLexicalBindingsInForStatement()
2350 compound_next = factory()->NewBinaryOperation( in DesugarLexicalBindingsInForStatement()
2355 factory()->NewExpressionStatement(compound_next, kNoSourcePosition); in DesugarLexicalBindingsInForStatement()
2370 Expression* const1 = factory()->NewSmiLiteral(1, kNoSourcePosition); in DesugarLexicalBindingsInForStatement()
2371 VariableProxy* flag_proxy = factory()->NewVariableProxy(flag); in DesugarLexicalBindingsInForStatement()
2372 compare = factory()->NewCompareOperation(Token::EQ, flag_proxy, const1, in DesugarLexicalBindingsInForStatement()
2376 factory()->NewBreakStatement(outer_loop, kNoSourcePosition); in DesugarLexicalBindingsInForStatement()
2377 Statement* empty = factory()->NewEmptyStatement(kNoSourcePosition); in DesugarLexicalBindingsInForStatement()
2379 factory()->NewIfStatement(compare, stop, empty, kNoSourcePosition); in DesugarLexicalBindingsInForStatement()
2381 factory()->NewBlock(NULL, 1, true, kNoSourcePosition); in DesugarLexicalBindingsInForStatement()
2730 FunctionLiteral* function_literal = factory()->NewFunctionLiteral( in ParseFunctionLiteral()
2850 Expression* condition = factory()->NewBinaryOperation( in BuildAssertIsCoercible()
2852 factory()->NewCompareOperation( in BuildAssertIsCoercible()
2853 Token::EQ_STRICT, factory()->NewVariableProxy(var), in BuildAssertIsCoercible()
2854 factory()->NewUndefinedLiteral(kNoSourcePosition), kNoSourcePosition), in BuildAssertIsCoercible()
2855 factory()->NewCompareOperation( in BuildAssertIsCoercible()
2856 Token::EQ_STRICT, factory()->NewVariableProxy(var), in BuildAssertIsCoercible()
2857 factory()->NewNullLiteral(kNoSourcePosition), kNoSourcePosition), in BuildAssertIsCoercible()
2862 IfStatement* if_statement = factory()->NewIfStatement( in BuildAssertIsCoercible()
2864 factory()->NewExpressionStatement(throw_type_error, kNoSourcePosition), in BuildAssertIsCoercible()
2865 factory()->NewEmptyStatement(kNoSourcePosition), kNoSourcePosition); in BuildAssertIsCoercible()
2910 Block* init_block = factory()->NewBlock(NULL, 1, true, kNoSourcePosition); in BuildParameterInitializationBlock()
2927 factory()->NewVariableProxy(parameters.scope->parameter(i)); in BuildParameterInitializationBlock()
2934 auto condition = factory()->NewCompareOperation( in BuildParameterInitializationBlock()
2936 factory()->NewVariableProxy(parameters.scope->parameter(i)), in BuildParameterInitializationBlock()
2937 factory()->NewUndefinedLiteral(kNoSourcePosition), kNoSourcePosition); in BuildParameterInitializationBlock()
2938 initial_value = factory()->NewConditional( in BuildParameterInitializationBlock()
2950 param_block = factory()->NewBlock(NULL, 8, true, kNoSourcePosition); in BuildParameterInitializationBlock()
2988 Block* result = factory()->NewBlock(nullptr, 2, true, kNoSourcePosition); in BuildRejectPromiseOnException()
2993 Expression* create_promise = factory()->NewCallRuntime( in BuildRejectPromiseOnException()
2996 Assignment* assign_promise = factory()->NewAssignment( in BuildRejectPromiseOnException()
2997 Token::INIT, factory()->NewVariableProxy(PromiseVariable()), in BuildRejectPromiseOnException()
3000 factory()->NewExpressionStatement(assign_promise, kNoSourcePosition); in BuildRejectPromiseOnException()
3010 Block* catch_block = factory()->NewBlock(nullptr, 1, true, kNoSourcePosition); in BuildRejectPromiseOnException()
3013 factory()->NewVariableProxy(catch_variable), kNoSourcePosition); in BuildRejectPromiseOnException()
3015 factory()->NewReturnStatement(promise_reject, kNoSourcePosition); in BuildRejectPromiseOnException()
3019 factory()->NewTryCatchStatementForAsyncAwait(inner_block, catch_scope, in BuildRejectPromiseOnException()
3025 factory()->NewBlock(nullptr, 1, true, kNoSourcePosition); in BuildRejectPromiseOnException()
3030 factory()->NewBlock(nullptr, 1, true, kNoSourcePosition); in BuildRejectPromiseOnException()
3033 args->Add(factory()->NewVariableProxy(PromiseVariable()), zone()); in BuildRejectPromiseOnException()
3034 Expression* call_promise_release = factory()->NewCallRuntime( in BuildRejectPromiseOnException()
3036 Statement* promise_release = factory()->NewExpressionStatement( in BuildRejectPromiseOnException()
3041 Statement* try_finally_statement = factory()->NewTryFinallyStatement( in BuildRejectPromiseOnException()
3051 args->Add(factory()->NewThisFunction(pos), zone()); in BuildCreateJSGeneratorObject()
3055 return factory()->NewCallRuntime(Runtime::kCreateJSGeneratorObject, args, in BuildCreateJSGeneratorObject()
3062 args->Add(factory()->NewVariableProxy(PromiseVariable()), zone()); in BuildResolvePromise()
3065 factory()->NewCallRuntime(Context::PROMISE_RESOLVE_INDEX, args, pos); in BuildResolvePromise()
3066 return factory()->NewBinaryOperation( in BuildResolvePromise()
3068 factory()->NewVariableProxy(PromiseVariable()), pos); in BuildResolvePromise()
3077 args->Add(factory()->NewVariableProxy(PromiseVariable()), zone()); in BuildRejectPromise()
3079 Expression* call_runtime = factory()->NewCallRuntime( in BuildRejectPromise()
3081 return factory()->NewBinaryOperation( in BuildRejectPromise()
3083 factory()->NewVariableProxy(PromiseVariable()), pos); in BuildRejectPromise()
3101 factory()->NewVariableProxy(function_state_->generator_object_variable()); in BuildInitialYield()
3102 Assignment* assignment = factory()->NewAssignment( in BuildInitialYield()
3105 factory()->NewVariableProxy(function_state_->generator_object_variable()); in BuildInitialYield()
3109 return factory()->NewYield(get_proxy, assignment, scope()->start_position(), in BuildInitialYield()
3185 inner_block = factory()->NewBlock(NULL, 8, true, kNoSourcePosition); in ParseEagerFunctionBody()
3206 factory()->NewBlock(nullptr, 3, false, kNoSourcePosition); in ParseEagerFunctionBody()
3209 factory()->NewExpressionStatement(initial_yield, kNoSourcePosition), in ParseEagerFunctionBody()
3213 Statement* final_return = factory()->NewReturnStatement( in ParseEagerFunctionBody()
3218 factory()->NewBlock(nullptr, 1, false, kNoSourcePosition); in ParseEagerFunctionBody()
3221 VariableProxy* call_proxy = factory()->NewVariableProxy( in ParseEagerFunctionBody()
3224 Expression* call = factory()->NewCallRuntime( in ParseEagerFunctionBody()
3227 factory()->NewExpressionStatement(call, kNoSourcePosition), zone()); in ParseEagerFunctionBody()
3229 body->Add(factory()->NewTryFinallyStatement(try_block, finally_block, in ParseEagerFunctionBody()
3241 body->Add(factory()->NewReturnStatement(ThisExpression(kNoSourcePosition), in ParseEagerFunctionBody()
3299 VariableProxy* fproxy = factory()->NewVariableProxy(fvar); in ParseEagerFunctionBody()
3300 statement = factory()->NewExpressionStatement( in ParseEagerFunctionBody()
3301 factory()->NewAssignment(Token::INIT, fproxy, in ParseEagerFunctionBody()
3302 factory()->NewThisFunction(pos), in ParseEagerFunctionBody()
3306 statement = factory()->NewEmptyStatement(kNoSourcePosition); in ParseEagerFunctionBody()
3317 Block* do_block = factory()->NewBlock(nullptr, 1, false, kNoSourcePosition); in InstallHomeObject()
3321 factory()->NewDoExpression(do_block, result_var, kNoSourcePosition); in InstallHomeObject()
3322 Assignment* init = factory()->NewAssignment( in InstallHomeObject()
3323 Token::ASSIGN, factory()->NewVariableProxy(result_var), function_literal, in InstallHomeObject()
3326 factory()->NewExpressionStatement(init, kNoSourcePosition), zone()); in InstallHomeObject()
3327 Property* home_object_property = factory()->NewProperty( in InstallHomeObject()
3328 factory()->NewVariableProxy(result_var), in InstallHomeObject()
3329 factory()->NewSymbolLiteral("home_object_symbol", kNoSourcePosition), in InstallHomeObject()
3331 Assignment* assignment = factory()->NewAssignment( in InstallHomeObject()
3334 factory()->NewExpressionStatement(assignment, kNoSourcePosition), zone()); in InstallHomeObject()
3377 VariableProxy* name_proxy = scope()->NewUnresolved(factory(), name); in SynthesizeClassFieldInitializer()
3381 scope()->NewUnresolved(factory(), function_name); in SynthesizeClassFieldInitializer()
3385 Expression* call = factory()->NewCallRuntime(Runtime::kInlineCall, args, in SynthesizeClassFieldInitializer()
3393 factory()->NewNumberLiteral(DONT_ENUM, kNoSourcePosition), zone()); in SynthesizeClassFieldInitializer()
3395 factory()->NewNumberLiteral( in SynthesizeClassFieldInitializer()
3400 body->Add(factory()->NewExpressionStatement( in SynthesizeClassFieldInitializer()
3401 factory()->NewCallRuntime( in SynthesizeClassFieldInitializer()
3409 body->Add(factory()->NewReturnStatement(ThisExpression(kNoSourcePosition), in SynthesizeClassFieldInitializer()
3412 FunctionLiteral* function_literal = factory()->NewFunctionLiteral( in SynthesizeClassFieldInitializer()
3426 Statement* call_initializer = factory()->NewExpressionStatement( in InsertClassFieldInitializer()
3430 factory(), ast_value_factory()->this_string(), kNoSourcePosition, in InsertClassFieldInitializer()
3447 class_info->proxy = factory()->NewVariableProxy(name, NORMAL_VARIABLE); in DeclareClassVariable()
3448 Declaration* declaration = factory()->NewVariableDeclaration( in DeclareClassVariable()
3483 factory()->NewVariableProxy(class_info->static_initializer_var)); in DeclareClassProperty()
3487 args->Add(factory()->NewVariableProxy(class_info->static_initializer_var), in DeclareClassProperty()
3489 Expression* call = factory()->NewCallRuntime(Runtime::kInlineCall, args, in DeclareClassProperty()
3498 property->set_key(factory()->NewCallRuntime( in DeclareClassProperty()
3505 factory()->NewVariableProxy(name, NORMAL_VARIABLE); in DeclareClassProperty()
3506 Declaration* name_declaration = factory()->NewVariableDeclaration( in DeclareClassProperty()
3514 property->set_value(factory()->NewVariableProxy(name_var)); in DeclareClassProperty()
3532 Block* do_block = factory()->NewBlock(nullptr, 1, false, pos); in RewriteClassLiteral()
3534 DoExpression* do_expr = factory()->NewDoExpression(do_block, result_var, pos); in RewriteClassLiteral()
3560 ClassLiteral* class_literal = factory()->NewClassLiteral( in RewriteClassLiteral()
3566 factory()->NewVariableProxy(class_info->static_initializer_var)); in RewriteClassLiteral()
3570 factory()->NewExpressionStatement( in RewriteClassLiteral()
3571 factory()->NewAssignment(Token::ASSIGN, in RewriteClassLiteral()
3572 factory()->NewVariableProxy(result_var), in RewriteClassLiteral()
3588 : factory()->NewBooleanLiteral(false, kNoSourcePosition); in RewriteClassLiteral()
3589 Assignment* assignment = factory()->NewAssignment( in RewriteClassLiteral()
3590 Token::INIT, factory()->NewVariableProxy(init_fn_var), initializer, in RewriteClassLiteral()
3593 factory()->NewExpressionStatement(assignment, kNoSourcePosition), in RewriteClassLiteral()
3600 factory()->NewVariableProxy(function_name, NORMAL_VARIABLE); in RewriteClassLiteral()
3601 Declaration* function_declaration = factory()->NewVariableDeclaration( in RewriteClassLiteral()
3607 Property* prototype_property = factory()->NewProperty( in RewriteClassLiteral()
3608 factory()->NewVariableProxy(result_var), in RewriteClassLiteral()
3609 factory()->NewStringLiteral(ast_value_factory()->prototype_string(), in RewriteClassLiteral()
3616 Assignment* function_assignment = factory()->NewAssignment( in RewriteClassLiteral()
3617 Token::INIT, factory()->NewVariableProxy(function_var), function_value, in RewriteClassLiteral()
3619 do_block->statements()->Add(factory()->NewExpressionStatement( in RewriteClassLiteral()
3631 return factory()->NewUndefinedLiteral(position); in GetLiteralUndefined()
3667 VariableProxy* from = factory()->NewVariableProxy(parameter); in InsertShadowingVarBindingInitializers()
3669 factory()->NewAssignment(Token::ASSIGN, to, from, kNoSourcePosition); in InsertShadowingVarBindingInitializers()
3671 factory()->NewExpressionStatement(assignment, kNoSourcePosition); in InsertShadowingVarBindingInitializers()
3684 scope->HoistSloppyBlockFunctions(factory()); in InsertSloppyBlockFunctionVarBindings()
3882 Literal* cooked = factory()->NewStringLiteral(tv, pos); in AddTemplateSpan()
3883 Literal* raw = factory()->NewStringLiteral(trv, pos); in AddTemplateSpan()
3916 Expression* middle = factory()->NewCallRuntime(Runtime::kInlineToString, in CloseTemplateLiteral()
3919 expr = factory()->NewBinaryOperation( in CloseTemplateLiteral()
3920 Token::ADD, factory()->NewBinaryOperation( in CloseTemplateLiteral()
3933 args->Add(factory()->NewArrayLiteral( in CloseTemplateLiteral()
3938 factory()->NewArrayLiteral( in CloseTemplateLiteral()
3944 args->Add(factory()->NewNumberLiteral(hash_obj->value(), pos), zone()); in CloseTemplateLiteral()
3946 Expression* call_site = factory()->NewCallRuntime( in CloseTemplateLiteral()
3954 return factory()->NewCall(tag, call_args, pos); in CloseTemplateLiteral()
4001 args->Add(factory()->NewCallRuntime(Runtime::kSpreadIterablePrepare, in PrepareSpreadArguments()
4025 args->Add(factory()->NewArrayLiteral(unspread, literal_index, in PrepareSpreadArguments()
4036 args->Add(factory()->NewCallRuntime(Context::SPREAD_ITERABLE_INDEX, in PrepareSpreadArguments()
4042 list->Add(factory()->NewCallRuntime(Context::SPREAD_ARGUMENTS_INDEX, args, in PrepareSpreadArguments()
4058 Expression* super_constructor = factory()->NewCallRuntime( in SpreadCall()
4062 return factory()->NewCallRuntime(Context::REFLECT_CONSTRUCT_INDEX, args, in SpreadCall()
4073 VariableProxy* obj = factory()->NewVariableProxy(temp); in SpreadCall()
4074 Assignment* assign_obj = factory()->NewAssignment( in SpreadCall()
4077 function = factory()->NewProperty( in SpreadCall()
4080 obj = factory()->NewVariableProxy(temp); in SpreadCall()
4086 args->InsertAt(1, factory()->NewUndefinedLiteral(kNoSourcePosition), in SpreadCall()
4089 return factory()->NewCallRuntime(Context::REFLECT_APPLY_INDEX, args, pos); in SpreadCall()
4097 return factory()->NewCallRuntime(Context::REFLECT_CONSTRUCT_INDEX, args, pos); in SpreadCallNew()
4132 expr = factory()->NewBinaryOperation(Token::COMMA, expr, args->at(i), in ExpressionListToExpression()
4154 Expression* init_generator_variable = factory()->NewAssignment( in PrepareAsyncFunctionBody()
4155 Token::INIT, factory()->NewVariableProxy(temp), in PrepareAsyncFunctionBody()
4157 body->Add(factory()->NewExpressionStatement(init_generator_variable, in PrepareAsyncFunctionBody()
4175 factory()->NewReturnStatement(return_value, return_value->position()), in RewriteAsyncFunctionBody()
4210 Block* do_block = factory()->NewBlock(nullptr, 2, false, nopos); in RewriteAwaitExpression()
4216 Expression* value_assignment = factory()->NewAssignment( in RewriteAwaitExpression()
4217 Token::ASSIGN, factory()->NewVariableProxy(temp_var), value, nopos); in RewriteAwaitExpression()
4219 factory()->NewExpressionStatement(value_assignment, value->position()), in RewriteAwaitExpression()
4225 factory()->NewVariableProxy(generator_object_variable); in RewriteAwaitExpression()
4227 async_function_await_args->Add(factory()->NewVariableProxy(temp_var), zone()); in RewriteAwaitExpression()
4228 async_function_await_args->Add(factory()->NewVariableProxy(promise), zone()); in RewriteAwaitExpression()
4234 factory()->NewCallRuntime(Context::ASYNC_FUNCTION_AWAIT_CAUGHT_INDEX, in RewriteAwaitExpression()
4237 factory()->NewExpressionStatement(async_function_await, await_pos), in RewriteAwaitExpression()
4241 Expression* do_expr = factory()->NewDoExpression(do_block, promise, nopos); in RewriteAwaitExpression()
4243 generator_object = factory()->NewVariableProxy(generator_object_variable); in RewriteAwaitExpression()
4244 return factory()->NewYield(generator_object, do_expr, nopos, in RewriteAwaitExpression()
4326 return factory()->NewCallRuntime(Context::MATH_POW_INDEX, args, pos); in RewriteExponentiation()
4341 factory()->NewCallRuntime(Context::MATH_POW_INDEX, args, pos); in RewriteAssignExponentiation()
4342 return factory()->NewAssignment(Token::ASSIGN, result, call, pos); in RewriteAssignExponentiation()
4347 Expression* assign_obj = factory()->NewAssignment( in RewriteAssignExponentiation()
4348 Token::ASSIGN, factory()->NewVariableProxy(temp_obj), prop->obj(), in RewriteAssignExponentiation()
4350 Expression* assign_key = factory()->NewAssignment( in RewriteAssignExponentiation()
4351 Token::ASSIGN, factory()->NewVariableProxy(temp_key), prop->key(), in RewriteAssignExponentiation()
4353 args->Add(factory()->NewProperty(factory()->NewVariableProxy(temp_obj), in RewriteAssignExponentiation()
4354 factory()->NewVariableProxy(temp_key), in RewriteAssignExponentiation()
4359 factory()->NewCallRuntime(Context::MATH_POW_INDEX, args, pos); in RewriteAssignExponentiation()
4360 Expression* target = factory()->NewProperty( in RewriteAssignExponentiation()
4361 factory()->NewVariableProxy(temp_obj), in RewriteAssignExponentiation()
4362 factory()->NewVariableProxy(temp_key), kNoSourcePosition); in RewriteAssignExponentiation()
4364 factory()->NewAssignment(Token::ASSIGN, target, call, pos); in RewriteAssignExponentiation()
4365 return factory()->NewBinaryOperation( in RewriteAssignExponentiation()
4367 factory()->NewBinaryOperation(Token::COMMA, assign_key, assign, pos), in RewriteAssignExponentiation()
4393 Expression* init_result = factory()->NewAssignment( in RewriteSpreads()
4394 Token::INIT, factory()->NewVariableProxy(result), lit, kNoSourcePosition); in RewriteSpreads()
4395 Block* do_block = factory()->NewBlock(nullptr, 16, false, kNoSourcePosition); in RewriteSpreads()
4397 factory()->NewExpressionStatement(init_result, kNoSourcePosition), in RewriteSpreads()
4411 append_element_args->Add(factory()->NewVariableProxy(result), zone()); in RewriteSpreads()
4414 factory()->NewExpressionStatement( in RewriteSpreads()
4415 factory()->NewCallRuntime(Runtime::kAppendElement, in RewriteSpreads()
4421 Property* length_property = factory()->NewProperty( in RewriteSpreads()
4422 factory()->NewVariableProxy(result), in RewriteSpreads()
4423 factory()->NewStringLiteral(ast_value_factory()->length_string(), in RewriteSpreads()
4426 CountOperation* count_op = factory()->NewCountOperation( in RewriteSpreads()
4429 factory()->NewExpressionStatement(count_op, kNoSourcePosition), in RewriteSpreads()
4440 append_element_args->Add(factory()->NewVariableProxy(result), zone()); in RewriteSpreads()
4441 append_element_args->Add(factory()->NewVariableProxy(each), zone()); in RewriteSpreads()
4442 append_body = factory()->NewExpressionStatement( in RewriteSpreads()
4443 factory()->NewCallRuntime(Runtime::kAppendElement, in RewriteSpreads()
4448 ForEachStatement* loop = factory()->NewForEachStatement( in RewriteSpreads()
4452 factory()->NewVariableProxy(each), subject, in RewriteSpreads()
4460 return factory()->NewDoExpression(do_block, result, lit->position()); in RewriteSpreads()
4606 WhileStatement* loop = factory()->NewWhileStatement(nullptr, nopos); in RewriteYieldStar()
4612 Expression* input_proxy = factory()->NewVariableProxy(var_input); in RewriteYieldStar()
4614 factory()->NewAssignment(Token::ASSIGN, input_proxy, in RewriteYieldStar()
4615 factory()->NewUndefinedLiteral(nopos), nopos); in RewriteYieldStar()
4616 initialize_input = factory()->NewExpressionStatement(assignment, nopos); in RewriteYieldStar()
4623 Expression* mode_proxy = factory()->NewVariableProxy(var_mode); in RewriteYieldStar()
4625 factory()->NewSmiLiteral(JSGeneratorObject::kNext, nopos); in RewriteYieldStar()
4627 factory()->NewAssignment(Token::ASSIGN, mode_proxy, knext, nopos); in RewriteYieldStar()
4628 initialize_mode = factory()->NewExpressionStatement(assignment, nopos); in RewriteYieldStar()
4635 Expression* output_proxy = factory()->NewVariableProxy(var_output); in RewriteYieldStar()
4637 factory()->NewAssignment(Token::ASSIGN, output_proxy, in RewriteYieldStar()
4638 factory()->NewUndefinedLiteral(nopos), nopos); in RewriteYieldStar()
4639 initialize_output = factory()->NewExpressionStatement(assignment, nopos); in RewriteYieldStar()
4647 Expression* iterator_proxy = factory()->NewVariableProxy(var_iterator); in RewriteYieldStar()
4648 Expression* assignment = factory()->NewAssignment( in RewriteYieldStar()
4650 get_iterator = factory()->NewExpressionStatement(assignment, nopos); in RewriteYieldStar()
4659 args->Add(factory()->NewVariableProxy(var_iterator), zone()); in RewriteYieldStar()
4661 factory()->NewCallRuntime(Runtime::kInlineIsJSReceiver, args, nopos); in RewriteYieldStar()
4669 throw_call = factory()->NewExpressionStatement(call, nopos); in RewriteYieldStar()
4672 validate_iterator = factory()->NewIfStatement( in RewriteYieldStar()
4673 is_receiver_call, factory()->NewEmptyStatement(nopos), throw_call, in RewriteYieldStar()
4680 Expression* iterator_proxy = factory()->NewVariableProxy(var_iterator); in RewriteYieldStar()
4682 factory()->NewStringLiteral(ast_value_factory()->next_string(), nopos); in RewriteYieldStar()
4684 factory()->NewProperty(iterator_proxy, literal, nopos); in RewriteYieldStar()
4685 Expression* input_proxy = factory()->NewVariableProxy(var_input); in RewriteYieldStar()
4688 Expression* call = factory()->NewCall(next_property, args, nopos); in RewriteYieldStar()
4689 Expression* output_proxy = factory()->NewVariableProxy(var_output); in RewriteYieldStar()
4691 factory()->NewAssignment(Token::ASSIGN, output_proxy, call, nopos); in RewriteYieldStar()
4692 call_next = factory()->NewExpressionStatement(assignment, nopos); in RewriteYieldStar()
4701 args->Add(factory()->NewVariableProxy(var_output), zone()); in RewriteYieldStar()
4703 factory()->NewCallRuntime(Runtime::kInlineIsJSReceiver, args, nopos); in RewriteYieldStar()
4709 args->Add(factory()->NewVariableProxy(var_output), zone()); in RewriteYieldStar()
4710 Expression* call = factory()->NewCallRuntime( in RewriteYieldStar()
4712 throw_call = factory()->NewExpressionStatement(call, nopos); in RewriteYieldStar()
4715 validate_next_output = factory()->NewIfStatement( in RewriteYieldStar()
4716 is_receiver_call, factory()->NewEmptyStatement(nopos), throw_call, in RewriteYieldStar()
4724 Expression* iterator_proxy = factory()->NewVariableProxy(var_iterator); in RewriteYieldStar()
4726 factory()->NewStringLiteral(ast_value_factory()->throw_string(), nopos); in RewriteYieldStar()
4728 factory()->NewProperty(iterator_proxy, literal, nopos); in RewriteYieldStar()
4729 Expression* throw_proxy = factory()->NewVariableProxy(var_throw); in RewriteYieldStar()
4731 factory()->NewAssignment(Token::ASSIGN, throw_proxy, property, nopos); in RewriteYieldStar()
4732 get_throw = factory()->NewExpressionStatement(assignment, nopos); in RewriteYieldStar()
4741 Expression* condition = factory()->NewCompareOperation( in RewriteYieldStar()
4742 Token::EQ, factory()->NewVariableProxy(var_throw), in RewriteYieldStar()
4743 factory()->NewNullLiteral(nopos), nopos); in RewriteYieldStar()
4747 Statement* throw_call = factory()->NewExpressionStatement(call, nopos); in RewriteYieldStar()
4749 Block* then = factory()->NewBlock(nullptr, 4 + 1, false, nopos); in RewriteYieldStar()
4752 factory()->NewSmiLiteral(Parser::kNormalCompletion, nopos)); in RewriteYieldStar()
4754 check_throw = factory()->NewIfStatement( in RewriteYieldStar()
4755 condition, then, factory()->NewEmptyStatement(nopos), nopos); in RewriteYieldStar()
4762 args->Add(factory()->NewVariableProxy(var_throw), zone()); in RewriteYieldStar()
4763 args->Add(factory()->NewVariableProxy(var_iterator), zone()); in RewriteYieldStar()
4764 args->Add(factory()->NewVariableProxy(var_input), zone()); in RewriteYieldStar()
4766 factory()->NewCallRuntime(Runtime::kInlineCall, args, nopos); in RewriteYieldStar()
4767 Expression* assignment = factory()->NewAssignment( in RewriteYieldStar()
4768 Token::ASSIGN, factory()->NewVariableProxy(var_output), call, nopos); in RewriteYieldStar()
4769 call_throw = factory()->NewExpressionStatement(assignment, nopos); in RewriteYieldStar()
4778 args->Add(factory()->NewVariableProxy(var_output), zone()); in RewriteYieldStar()
4780 factory()->NewCallRuntime(Runtime::kInlineIsJSReceiver, args, nopos); in RewriteYieldStar()
4786 args->Add(factory()->NewVariableProxy(var_output), zone()); in RewriteYieldStar()
4787 Expression* call = factory()->NewCallRuntime( in RewriteYieldStar()
4789 throw_call = factory()->NewExpressionStatement(call, nopos); in RewriteYieldStar()
4792 validate_throw_output = factory()->NewIfStatement( in RewriteYieldStar()
4793 is_receiver_call, factory()->NewEmptyStatement(nopos), throw_call, in RewriteYieldStar()
4800 Expression* output_proxy = factory()->NewVariableProxy(var_output); in RewriteYieldStar()
4802 factory()->NewStringLiteral(ast_value_factory()->done_string(), nopos); in RewriteYieldStar()
4803 Expression* property = factory()->NewProperty(output_proxy, literal, nopos); in RewriteYieldStar()
4804 BreakStatement* break_loop = factory()->NewBreakStatement(loop, nopos); in RewriteYieldStar()
4805 if_done = factory()->NewIfStatement( in RewriteYieldStar()
4806 property, break_loop, factory()->NewEmptyStatement(nopos), nopos); in RewriteYieldStar()
4813 Expression* mode_proxy = factory()->NewVariableProxy(var_mode); in RewriteYieldStar()
4815 factory()->NewSmiLiteral(JSGeneratorObject::kReturn, nopos); in RewriteYieldStar()
4817 factory()->NewAssignment(Token::ASSIGN, mode_proxy, kreturn, nopos); in RewriteYieldStar()
4818 set_mode_return = factory()->NewExpressionStatement(assignment, nopos); in RewriteYieldStar()
4824 Expression* output_proxy = factory()->NewVariableProxy(var_output); in RewriteYieldStar()
4825 Yield* yield = factory()->NewYield(generator, output_proxy, nopos, in RewriteYieldStar()
4827 yield_output = factory()->NewExpressionStatement(yield, nopos); in RewriteYieldStar()
4833 Expression* mode_proxy = factory()->NewVariableProxy(var_mode); in RewriteYieldStar()
4835 factory()->NewSmiLiteral(JSGeneratorObject::kNext, nopos); in RewriteYieldStar()
4837 factory()->NewAssignment(Token::ASSIGN, mode_proxy, knext, nopos); in RewriteYieldStar()
4838 set_mode_next = factory()->NewExpressionStatement(assignment, nopos); in RewriteYieldStar()
4844 Expression* mode_proxy = factory()->NewVariableProxy(var_mode); in RewriteYieldStar()
4846 factory()->NewSmiLiteral(JSGeneratorObject::kThrow, nopos); in RewriteYieldStar()
4848 factory()->NewAssignment(Token::ASSIGN, mode_proxy, kthrow, nopos); in RewriteYieldStar()
4849 set_mode_throw = factory()->NewExpressionStatement(assignment, nopos); in RewriteYieldStar()
4856 Expression* input_proxy = factory()->NewVariableProxy(var_input); in RewriteYieldStar()
4857 Expression* assignment = factory()->NewAssignment( in RewriteYieldStar()
4859 get_input = factory()->NewExpressionStatement(assignment, nopos); in RewriteYieldStar()
4867 Expression* mode_proxy = factory()->NewVariableProxy(var_mode); in RewriteYieldStar()
4869 factory()->NewSmiLiteral(JSGeneratorObject::kReturn, nopos); in RewriteYieldStar()
4870 Expression* condition = factory()->NewCompareOperation( in RewriteYieldStar()
4873 Expression* output_proxy = factory()->NewVariableProxy(var_output); in RewriteYieldStar()
4875 factory()->NewStringLiteral(ast_value_factory()->value_string(), nopos); in RewriteYieldStar()
4876 Expression* property = factory()->NewProperty(output_proxy, literal, nopos); in RewriteYieldStar()
4877 Statement* return_value = factory()->NewReturnStatement( in RewriteYieldStar()
4880 maybe_return_value = factory()->NewIfStatement( in RewriteYieldStar()
4881 condition, return_value, factory()->NewEmptyStatement(nopos), nopos); in RewriteYieldStar()
4887 Expression* output_proxy = factory()->NewVariableProxy(var_output); in RewriteYieldStar()
4889 factory()->NewStringLiteral(ast_value_factory()->value_string(), nopos); in RewriteYieldStar()
4890 Expression* property = factory()->NewProperty(output_proxy, literal, nopos); in RewriteYieldStar()
4891 get_value = factory()->NewExpressionStatement(property, nopos); in RewriteYieldStar()
4899 Block* try_block = factory()->NewBlock(nullptr, 2, false, nopos); in RewriteYieldStar()
4903 Block* catch_block = factory()->NewBlock(nullptr, 1, false, nopos); in RewriteYieldStar()
4912 try_catch = factory()->NewTryCatchStatementForDesugaring( in RewriteYieldStar()
4919 Block* try_block = factory()->NewBlock(nullptr, 1, false, nopos); in RewriteYieldStar()
4922 Block* finally = factory()->NewBlock(nullptr, 2, false, nopos); in RewriteYieldStar()
4924 finally->statements()->Add(factory()->NewContinueStatement(loop, nopos), in RewriteYieldStar()
4927 try_finally = factory()->NewTryFinallyStatement(try_block, finally, nopos); in RewriteYieldStar()
4931 SwitchStatement* switch_mode = factory()->NewSwitchStatement(nullptr, nopos); in RewriteYieldStar()
4936 case_next->Add(factory()->NewBreakStatement(switch_mode, nopos), zone()); in RewriteYieldStar()
4940 case_return->Add(factory()->NewBreakStatement(switch_mode, nopos), zone()); in RewriteYieldStar()
4947 case_throw->Add(factory()->NewBreakStatement(switch_mode, nopos), zone()); in RewriteYieldStar()
4951 factory()->NewSmiLiteral(JSGeneratorObject::kNext, nopos); in RewriteYieldStar()
4953 factory()->NewSmiLiteral(JSGeneratorObject::kReturn, nopos); in RewriteYieldStar()
4955 factory()->NewSmiLiteral(JSGeneratorObject::kThrow, nopos); in RewriteYieldStar()
4956 cases->Add(factory()->NewCaseClause(knext, case_next, nopos), zone()); in RewriteYieldStar()
4957 cases->Add(factory()->NewCaseClause(kreturn, case_return, nopos), zone()); in RewriteYieldStar()
4958 cases->Add(factory()->NewCaseClause(kthrow, case_throw, nopos), zone()); in RewriteYieldStar()
4960 switch_mode->Initialize(factory()->NewVariableProxy(var_mode), cases); in RewriteYieldStar()
4966 Block* loop_body = factory()->NewBlock(nullptr, 4, false, nopos); in RewriteYieldStar()
4972 loop->Initialize(factory()->NewBooleanLiteral(true, nopos), loop_body); in RewriteYieldStar()
4981 Block* do_block_ = factory()->NewBlock(nullptr, 7, true, nopos); in RewriteYieldStar()
4990 Block* do_block = factory()->NewBlock(nullptr, 2, false, nopos); in RewriteYieldStar()
4996 yield_star = factory()->NewDoExpression(do_block, dot_result, nopos); in RewriteYieldStar()
5007 Expression* type_of = factory()->NewUnaryOperation( in CheckCallable()
5008 Token::TYPEOF, factory()->NewVariableProxy(var), nopos); in CheckCallable()
5009 Expression* function_literal = factory()->NewStringLiteral( in CheckCallable()
5011 Expression* condition = factory()->NewCompareOperation( in CheckCallable()
5014 Statement* throw_call = factory()->NewExpressionStatement(error, pos); in CheckCallable()
5016 validate_var = factory()->NewIfStatement( in CheckCallable()
5017 condition, factory()->NewEmptyStatement(nopos), throw_call, nopos); in CheckCallable()
5043 Expression* iterator_proxy = factory()->NewVariableProxy(iterator); in BuildIteratorClose()
5044 Expression* literal = factory()->NewStringLiteral( in BuildIteratorClose()
5047 factory()->NewProperty(iterator_proxy, literal, nopos); in BuildIteratorClose()
5048 Expression* return_proxy = factory()->NewVariableProxy(var_return); in BuildIteratorClose()
5050 factory()->NewAssignment(Token::ASSIGN, return_proxy, property, nopos); in BuildIteratorClose()
5051 get_return = factory()->NewExpressionStatement(assignment, nopos); in BuildIteratorClose()
5059 Expression* condition = factory()->NewCompareOperation( in BuildIteratorClose()
5060 Token::EQ, factory()->NewVariableProxy(var_return), in BuildIteratorClose()
5061 factory()->NewNullLiteral(nopos), nopos); in BuildIteratorClose()
5063 Expression* value = factory()->NewVariableProxy(input); in BuildIteratorClose()
5066 factory()->NewReturnStatement(BuildIteratorResult(value, true), nopos); in BuildIteratorClose()
5068 check_return = factory()->NewIfStatement( in BuildIteratorClose()
5069 condition, return_input, factory()->NewEmptyStatement(nopos), nopos); in BuildIteratorClose()
5076 args->Add(factory()->NewVariableProxy(var_return), zone()); in BuildIteratorClose()
5077 args->Add(factory()->NewVariableProxy(iterator), zone()); in BuildIteratorClose()
5078 args->Add(factory()->NewVariableProxy(input), zone()); in BuildIteratorClose()
5081 factory()->NewCallRuntime(Runtime::kInlineCall, args, nopos); in BuildIteratorClose()
5082 Expression* output_proxy = factory()->NewVariableProxy(var_output); in BuildIteratorClose()
5084 factory()->NewAssignment(Token::ASSIGN, output_proxy, call, nopos); in BuildIteratorClose()
5085 call_return = factory()->NewExpressionStatement(assignment, nopos); in BuildIteratorClose()
5094 args->Add(factory()->NewVariableProxy(var_output), zone()); in BuildIteratorClose()
5096 factory()->NewCallRuntime(Runtime::kInlineIsJSReceiver, args, nopos); in BuildIteratorClose()
5102 args->Add(factory()->NewVariableProxy(var_output), zone()); in BuildIteratorClose()
5103 Expression* call = factory()->NewCallRuntime( in BuildIteratorClose()
5105 throw_call = factory()->NewExpressionStatement(call, nopos); in BuildIteratorClose()
5108 validate_output = factory()->NewIfStatement( in BuildIteratorClose()
5109 is_receiver_call, factory()->NewEmptyStatement(nopos), throw_call, in BuildIteratorClose()
5146 Expression* proxy = factory()->NewVariableProxy(completion); in FinalizeIteratorUse()
5147 Expression* assignment = factory()->NewAssignment( in FinalizeIteratorUse()
5149 factory()->NewSmiLiteral(Parser::kNormalCompletion, nopos), nopos); in FinalizeIteratorUse()
5151 factory()->NewExpressionStatement(assignment, nopos); in FinalizeIteratorUse()
5157 Expression* condition = factory()->NewCompareOperation( in FinalizeIteratorUse()
5158 Token::EQ_STRICT, factory()->NewVariableProxy(completion), in FinalizeIteratorUse()
5159 factory()->NewSmiLiteral(Parser::kAbruptCompletion, nopos), nopos); in FinalizeIteratorUse()
5161 Expression* proxy = factory()->NewVariableProxy(completion); in FinalizeIteratorUse()
5162 Expression* assignment = factory()->NewAssignment( in FinalizeIteratorUse()
5164 factory()->NewSmiLiteral(Parser::kThrowCompletion, nopos), nopos); in FinalizeIteratorUse()
5165 Statement* statement = factory()->NewExpressionStatement(assignment, nopos); in FinalizeIteratorUse()
5166 set_completion_throw = factory()->NewIfStatement( in FinalizeIteratorUse()
5167 condition, statement, factory()->NewEmptyStatement(nopos), nopos); in FinalizeIteratorUse()
5175 Block* block = factory()->NewBlock(nullptr, 2, true, nopos); in FinalizeIteratorUse()
5176 Expression* proxy = factory()->NewVariableProxy(completion); in FinalizeIteratorUse()
5181 maybe_close = factory()->NewBlock(nullptr, 1, true, nopos); in FinalizeIteratorUse()
5183 factory()->NewIfStatement(condition, block, in FinalizeIteratorUse()
5184 factory()->NewEmptyStatement(nopos), nopos), in FinalizeIteratorUse()
5208 args->Add(factory()->NewVariableProxy(catch_variable), zone()); in FinalizeIteratorUse()
5209 rethrow = factory()->NewExpressionStatement( in FinalizeIteratorUse()
5210 factory()->NewCallRuntime(Runtime::kReThrow, args, nopos), nopos); in FinalizeIteratorUse()
5213 Block* catch_block = factory()->NewBlock(nullptr, 2, false, nopos); in FinalizeIteratorUse()
5217 try_catch = factory()->NewTryCatchStatementForReThrow( in FinalizeIteratorUse()
5224 Block* try_block = factory()->NewBlock(nullptr, 1, false, nopos); in FinalizeIteratorUse()
5228 factory()->NewTryFinallyStatement(try_block, maybe_close, nopos); in FinalizeIteratorUse()
5264 Expression* iterator_proxy = factory()->NewVariableProxy(iterator); in BuildIteratorCloseForCompletion()
5265 Expression* literal = factory()->NewStringLiteral( in BuildIteratorCloseForCompletion()
5268 factory()->NewProperty(iterator_proxy, literal, nopos); in BuildIteratorCloseForCompletion()
5269 Expression* return_proxy = factory()->NewVariableProxy(var_return); in BuildIteratorCloseForCompletion()
5271 factory()->NewAssignment(Token::ASSIGN, return_proxy, property, nopos); in BuildIteratorCloseForCompletion()
5272 get_return = factory()->NewExpressionStatement(assignment, nopos); in BuildIteratorCloseForCompletion()
5290 args->Add(factory()->NewVariableProxy(var_return), zone()); in BuildIteratorCloseForCompletion()
5291 args->Add(factory()->NewVariableProxy(iterator), zone()); in BuildIteratorCloseForCompletion()
5294 factory()->NewCallRuntime(Runtime::kInlineCall, args, nopos); in BuildIteratorCloseForCompletion()
5296 Block* try_block = factory()->NewBlock(nullptr, 1, false, nopos); in BuildIteratorCloseForCompletion()
5297 try_block->statements()->Add(factory()->NewExpressionStatement(call, nopos), in BuildIteratorCloseForCompletion()
5300 Block* catch_block = factory()->NewBlock(nullptr, 0, false, nopos); in BuildIteratorCloseForCompletion()
5308 try_call_return = factory()->NewTryCatchStatement( in BuildIteratorCloseForCompletion()
5322 args->Add(factory()->NewVariableProxy(var_return), zone()); in BuildIteratorCloseForCompletion()
5323 args->Add(factory()->NewVariableProxy(iterator), zone()); in BuildIteratorCloseForCompletion()
5325 factory()->NewCallRuntime(Runtime::kInlineCall, args, nopos); in BuildIteratorCloseForCompletion()
5327 Expression* output_proxy = factory()->NewVariableProxy(var_output); in BuildIteratorCloseForCompletion()
5329 factory()->NewAssignment(Token::ASSIGN, output_proxy, call, nopos); in BuildIteratorCloseForCompletion()
5330 call_return = factory()->NewExpressionStatement(assignment, nopos); in BuildIteratorCloseForCompletion()
5336 args->Add(factory()->NewVariableProxy(var_output), zone()); in BuildIteratorCloseForCompletion()
5338 factory()->NewCallRuntime(Runtime::kInlineIsJSReceiver, args, nopos); in BuildIteratorCloseForCompletion()
5344 args->Add(factory()->NewVariableProxy(var_output), zone()); in BuildIteratorCloseForCompletion()
5345 Expression* call = factory()->NewCallRuntime( in BuildIteratorCloseForCompletion()
5347 throw_call = factory()->NewExpressionStatement(call, nopos); in BuildIteratorCloseForCompletion()
5350 Statement* check_return = factory()->NewIfStatement( in BuildIteratorCloseForCompletion()
5351 is_receiver_call, factory()->NewEmptyStatement(nopos), throw_call, in BuildIteratorCloseForCompletion()
5354 validate_return = factory()->NewBlock(nullptr, 2, false, nopos); in BuildIteratorCloseForCompletion()
5367 Expression* condition = factory()->NewCompareOperation( in BuildIteratorCloseForCompletion()
5369 factory()->NewSmiLiteral(Parser::kThrowCompletion, nopos), nopos); in BuildIteratorCloseForCompletion()
5371 Block* then_block = factory()->NewBlock(nullptr, 2, false, nopos); in BuildIteratorCloseForCompletion()
5375 call_return_carefully = factory()->NewIfStatement(condition, then_block, in BuildIteratorCloseForCompletion()
5382 Expression* condition = factory()->NewCompareOperation( in BuildIteratorCloseForCompletion()
5383 Token::EQ, factory()->NewVariableProxy(var_return), in BuildIteratorCloseForCompletion()
5384 factory()->NewNullLiteral(nopos), nopos); in BuildIteratorCloseForCompletion()
5386 maybe_call_return = factory()->NewIfStatement( in BuildIteratorCloseForCompletion()
5387 condition, factory()->NewEmptyStatement(nopos), call_return_carefully, in BuildIteratorCloseForCompletion()
5423 Expression* lhs = factory()->NewCompareOperation( in FinalizeForOfStatement()
5424 Token::EQ_STRICT, factory()->NewVariableProxy(var_completion), in FinalizeForOfStatement()
5425 factory()->NewSmiLiteral(Parser::kNormalCompletion, nopos), nopos); in FinalizeForOfStatement()
5426 Expression* rhs = factory()->NewCompareOperation( in FinalizeForOfStatement()
5427 Token::EQ_STRICT, factory()->NewVariableProxy(loop->iterator()), in FinalizeForOfStatement()
5428 factory()->NewUndefinedLiteral(nopos), nopos); in FinalizeForOfStatement()
5429 closing_condition = factory()->NewUnaryOperation( in FinalizeForOfStatement()
5430 Token::NOT, factory()->NewBinaryOperation(Token::OR, lhs, rhs, nopos), in FinalizeForOfStatement()
5434 Block* final_loop = factory()->NewBlock(nullptr, 2, false, nopos); in FinalizeForOfStatement()
5436 Block* try_block = factory()->NewBlock(nullptr, 1, false, nopos); in FinalizeForOfStatement()