OLD | NEW |
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.h" | 10 #include "src/ast/ast.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 } | 169 } |
170 | 170 |
171 // Helper for putting parts of the parse results into a temporary zone when | 171 // Helper for putting parts of the parse results into a temporary zone when |
172 // parsing inner function bodies. | 172 // parsing inner function bodies. |
173 class DiscardableZoneScope { | 173 class DiscardableZoneScope { |
174 public: | 174 public: |
175 DiscardableZoneScope(Parser* parser, Zone* temp_zone, bool use_temp_zone) | 175 DiscardableZoneScope(Parser* parser, Zone* temp_zone, bool use_temp_zone) |
176 : ast_node_factory_scope_(parser->factory(), temp_zone, use_temp_zone), | 176 : ast_node_factory_scope_(parser->factory(), temp_zone, use_temp_zone), |
177 fni_(parser->ast_value_factory_, temp_zone), | 177 fni_(parser->ast_value_factory_, temp_zone), |
178 parser_(parser), | 178 parser_(parser), |
179 prev_fni_(parser->fni_) { | 179 prev_fni_(parser->fni_), |
| 180 prev_zone_(parser->zone_) { |
180 if (use_temp_zone) { | 181 if (use_temp_zone) { |
181 parser_->fni_ = &fni_; | 182 parser_->fni_ = &fni_; |
| 183 parser_->zone_ = temp_zone; |
182 } | 184 } |
183 } | 185 } |
184 ~DiscardableZoneScope() { parser_->fni_ = prev_fni_; } | 186 ~DiscardableZoneScope() { |
| 187 parser_->fni_ = prev_fni_; |
| 188 parser_->zone_ = prev_zone_; |
| 189 } |
185 | 190 |
186 private: | 191 private: |
187 AstNodeFactory::BodyScope ast_node_factory_scope_; | 192 AstNodeFactory::BodyScope ast_node_factory_scope_; |
188 FuncNameInferrer fni_; | 193 FuncNameInferrer fni_; |
189 Parser* parser_; | 194 Parser* parser_; |
190 FuncNameInferrer* prev_fni_; | 195 FuncNameInferrer* prev_fni_; |
| 196 Zone* prev_zone_; |
| 197 |
| 198 DISALLOW_COPY_AND_ASSIGN(DiscardableZoneScope); |
191 }; | 199 }; |
192 | 200 |
193 void Parser::SetCachedData(ParseInfo* info) { | 201 void Parser::SetCachedData(ParseInfo* info) { |
194 if (compile_options_ == ScriptCompiler::kNoCompileOptions) { | 202 if (compile_options_ == ScriptCompiler::kNoCompileOptions) { |
195 cached_parse_data_ = NULL; | 203 cached_parse_data_ = NULL; |
196 } else { | 204 } else { |
197 DCHECK(info->cached_data() != NULL); | 205 DCHECK(info->cached_data() != NULL); |
198 if (compile_options_ == ScriptCompiler::kConsumeParserCache) { | 206 if (compile_options_ == ScriptCompiler::kConsumeParserCache) { |
199 cached_parse_data_ = ParseData::FromCachedData(*info->cached_data()); | 207 cached_parse_data_ = ParseData::FromCachedData(*info->cached_data()); |
200 } | 208 } |
(...skipping 4076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4277 // Anonymous functions were passed either the empty symbol or a null | 4285 // Anonymous functions were passed either the empty symbol or a null |
4278 // handle as the function name. Remember if we were passed a non-empty | 4286 // handle as the function name. Remember if we were passed a non-empty |
4279 // handle to decide whether to invoke function name inference. | 4287 // handle to decide whether to invoke function name inference. |
4280 bool should_infer_name = function_name == NULL; | 4288 bool should_infer_name = function_name == NULL; |
4281 | 4289 |
4282 // We want a non-null handle as the function name. | 4290 // We want a non-null handle as the function name. |
4283 if (should_infer_name) { | 4291 if (should_infer_name) { |
4284 function_name = ast_value_factory()->empty_string(); | 4292 function_name = ast_value_factory()->empty_string(); |
4285 } | 4293 } |
4286 | 4294 |
4287 Scope* scope = NewFunctionScope(kind); | 4295 FunctionLiteral::EagerCompileHint eager_compile_hint = |
4288 SetLanguageMode(scope, language_mode); | 4296 function_state_->next_function_is_parenthesized() |
4289 ZoneList<Statement*>* body = NULL; | 4297 ? FunctionLiteral::kShouldEagerCompile |
| 4298 : FunctionLiteral::kShouldLazyCompile; |
| 4299 |
| 4300 // Determine if the function can be parsed lazily. Lazy parsing is |
| 4301 // different from lazy compilation; we need to parse more eagerly than we |
| 4302 // compile. |
| 4303 |
| 4304 // We can only parse lazily if we also compile lazily. The heuristics for lazy |
| 4305 // compilation are: |
| 4306 // - It must not have been prohibited by the caller to Parse (some callers |
| 4307 // need a full AST). |
| 4308 // - The outer scope must allow lazy compilation of inner functions. |
| 4309 // - The function mustn't be a function expression with an open parenthesis |
| 4310 // before; we consider that a hint that the function will be called |
| 4311 // immediately, and it would be a waste of time to make it lazily |
| 4312 // compiled. |
| 4313 // These are all things we can know at this point, without looking at the |
| 4314 // function itself. |
| 4315 |
| 4316 // In addition, we need to distinguish between these cases: |
| 4317 // (function foo() { |
| 4318 // bar = function() { return 1; } |
| 4319 // })(); |
| 4320 // and |
| 4321 // (function foo() { |
| 4322 // var a = 1; |
| 4323 // bar = function() { return a; } |
| 4324 // })(); |
| 4325 |
| 4326 // Now foo will be parsed eagerly and compiled eagerly (optimization: assume |
| 4327 // parenthesis before the function means that it will be called |
| 4328 // immediately). The inner function *must* be parsed eagerly to resolve the |
| 4329 // possible reference to the variable in foo's scope. However, it's possible |
| 4330 // that it will be compiled lazily. |
| 4331 |
| 4332 // To make this additional case work, both Parser and PreParser implement a |
| 4333 // logic where only top-level functions will be parsed lazily. |
| 4334 bool is_lazily_parsed = mode() == PARSE_LAZILY && |
| 4335 this->scope()->AllowsLazyParsing() && |
| 4336 !function_state_->next_function_is_parenthesized(); |
| 4337 |
| 4338 // Determine whether the function body can be discarded after parsing. |
| 4339 // The preconditions are: |
| 4340 // - Lazy compilation has to be enabled. |
| 4341 // - Neither V8 natives nor native function declarations can be allowed, |
| 4342 // since parsing one would retroactively force the function to be |
| 4343 // eagerly compiled. |
| 4344 // - The invoker of this parser can't depend on the AST being eagerly |
| 4345 // built (either because the function is about to be compiled, or |
| 4346 // because the AST is going to be inspected for some reason). |
| 4347 // - Because of the above, we can't be attempting to parse a |
| 4348 // FunctionExpression; even without enclosing parentheses it might be |
| 4349 // immediately invoked. |
| 4350 // - The function literal shouldn't be hinted to eagerly compile. |
| 4351 // - For asm.js functions the body needs to be available when module |
| 4352 // validation is active, because we examine the entire module at once. |
| 4353 bool use_temp_zone = |
| 4354 !is_lazily_parsed && FLAG_lazy && !allow_natives() && |
| 4355 extension_ == NULL && allow_lazy() && |
| 4356 function_type == FunctionLiteral::kDeclaration && |
| 4357 eager_compile_hint != FunctionLiteral::kShouldEagerCompile && |
| 4358 !(FLAG_validate_asm && scope()->asm_module()); |
| 4359 |
| 4360 Scope* main_scope = nullptr; |
| 4361 if (use_temp_zone) { |
| 4362 // This Scope lives in the main Zone; we'll migrate data into it later. |
| 4363 main_scope = NewFunctionScope(kind); |
| 4364 } |
| 4365 |
| 4366 ZoneList<Statement*>* body = nullptr; |
4290 int arity = -1; | 4367 int arity = -1; |
4291 int materialized_literal_count = -1; | 4368 int materialized_literal_count = -1; |
4292 int expected_property_count = -1; | 4369 int expected_property_count = -1; |
4293 DuplicateFinder duplicate_finder(scanner()->unicode_cache()); | 4370 DuplicateFinder duplicate_finder(scanner()->unicode_cache()); |
4294 bool should_be_used_once_hint = false; | 4371 bool should_be_used_once_hint = false; |
4295 bool has_duplicate_parameters; | 4372 bool has_duplicate_parameters; |
4296 FunctionLiteral::EagerCompileHint eager_compile_hint; | |
4297 | 4373 |
4298 // Parse function. | |
4299 { | 4374 { |
| 4375 // Temporary zones can nest. When we migrate free variables (see below), we |
| 4376 // need to recreate them in the previous Zone. |
| 4377 AstNodeFactory previous_zone_ast_node_factory(ast_value_factory()); |
| 4378 previous_zone_ast_node_factory.set_zone(zone()); |
| 4379 |
| 4380 // Open a new zone scope, which sets our AstNodeFactory to allocate in the |
| 4381 // new temporary zone if the preconditions are satisfied, and ensures that |
| 4382 // the previous zone is always restored after parsing the body. To be able |
| 4383 // to do scope analysis correctly after full parsing, we migrate needed |
| 4384 // information from scope into main_scope when the function has been parsed. |
| 4385 Zone temp_zone(zone()->allocator()); |
| 4386 DiscardableZoneScope zone_scope(this, &temp_zone, use_temp_zone); |
| 4387 |
| 4388 Scope* scope = NewFunctionScope(kind); |
| 4389 SetLanguageMode(scope, language_mode); |
| 4390 if (!use_temp_zone) { |
| 4391 main_scope = scope; |
| 4392 } else { |
| 4393 DCHECK(main_scope->zone() != scope->zone()); |
| 4394 } |
| 4395 |
4300 FunctionState function_state(&function_state_, &scope_state_, scope, kind); | 4396 FunctionState function_state(&function_state_, &scope_state_, scope, kind); |
4301 #ifdef DEBUG | 4397 #ifdef DEBUG |
4302 this->scope()->SetScopeName(function_name); | 4398 this->scope()->SetScopeName(function_name); |
4303 #endif | 4399 #endif |
4304 ExpressionClassifier formals_classifier(this, &duplicate_finder); | 4400 ExpressionClassifier formals_classifier(this, &duplicate_finder); |
4305 | 4401 |
4306 eager_compile_hint = function_state_->this_function_is_parenthesized() | |
4307 ? FunctionLiteral::kShouldEagerCompile | |
4308 : FunctionLiteral::kShouldLazyCompile; | |
4309 | |
4310 if (is_generator) { | 4402 if (is_generator) { |
4311 // For generators, allocating variables in contexts is currently a win | 4403 // For generators, allocating variables in contexts is currently a win |
4312 // because it minimizes the work needed to suspend and resume an | 4404 // because it minimizes the work needed to suspend and resume an |
4313 // activation. The machine code produced for generators (by full-codegen) | 4405 // activation. The machine code produced for generators (by full-codegen) |
4314 // relies on this forced context allocation, but not in an essential way. | 4406 // relies on this forced context allocation, but not in an essential way. |
4315 this->scope()->ForceContextAllocation(); | 4407 this->scope()->ForceContextAllocation(); |
4316 | 4408 |
4317 // Calling a generator returns a generator object. That object is stored | 4409 // Calling a generator returns a generator object. That object is stored |
4318 // in a temporary variable, a definition that is used by "yield" | 4410 // in a temporary variable, a definition that is used by "yield" |
4319 // expressions. This also marks the FunctionState as a generator. | 4411 // expressions. This also marks the FunctionState as a generator. |
(...skipping 12 matching lines...) Expand all Loading... |
4332 int formals_end_position = scanner()->location().end_pos; | 4424 int formals_end_position = scanner()->location().end_pos; |
4333 | 4425 |
4334 CheckArityRestrictions(arity, kind, formals.has_rest, start_position, | 4426 CheckArityRestrictions(arity, kind, formals.has_rest, start_position, |
4335 formals_end_position, CHECK_OK); | 4427 formals_end_position, CHECK_OK); |
4336 Expect(Token::LBRACE, CHECK_OK); | 4428 Expect(Token::LBRACE, CHECK_OK); |
4337 // Don't include the rest parameter into the function's formal parameter | 4429 // Don't include the rest parameter into the function's formal parameter |
4338 // count (esp. the SharedFunctionInfo::internal_formal_parameter_count, | 4430 // count (esp. the SharedFunctionInfo::internal_formal_parameter_count, |
4339 // which says whether we need to create an arguments adaptor frame). | 4431 // which says whether we need to create an arguments adaptor frame). |
4340 if (formals.has_rest) arity--; | 4432 if (formals.has_rest) arity--; |
4341 | 4433 |
4342 // Determine if the function can be parsed lazily. Lazy parsing is different | |
4343 // from lazy compilation; we need to parse more eagerly than we compile. | |
4344 | |
4345 // We can only parse lazily if we also compile lazily. The heuristics for | |
4346 // lazy compilation are: | |
4347 // - It must not have been prohibited by the caller to Parse (some callers | |
4348 // need a full AST). | |
4349 // - The outer scope must allow lazy compilation of inner functions. | |
4350 // - The function mustn't be a function expression with an open parenthesis | |
4351 // before; we consider that a hint that the function will be called | |
4352 // immediately, and it would be a waste of time to make it lazily | |
4353 // compiled. | |
4354 // These are all things we can know at this point, without looking at the | |
4355 // function itself. | |
4356 | |
4357 // In addition, we need to distinguish between these cases: | |
4358 // (function foo() { | |
4359 // bar = function() { return 1; } | |
4360 // })(); | |
4361 // and | |
4362 // (function foo() { | |
4363 // var a = 1; | |
4364 // bar = function() { return a; } | |
4365 // })(); | |
4366 | |
4367 // Now foo will be parsed eagerly and compiled eagerly (optimization: assume | |
4368 // parenthesis before the function means that it will be called | |
4369 // immediately). The inner function *must* be parsed eagerly to resolve the | |
4370 // possible reference to the variable in foo's scope. However, it's possible | |
4371 // that it will be compiled lazily. | |
4372 | |
4373 // To make this additional case work, both Parser and PreParser implement a | |
4374 // logic where only top-level functions will be parsed lazily. | |
4375 bool is_lazily_parsed = mode() == PARSE_LAZILY && | |
4376 this->scope()->AllowsLazyParsing() && | |
4377 !function_state_->this_function_is_parenthesized(); | |
4378 | |
4379 // Eager or lazy parse? | 4434 // Eager or lazy parse? |
4380 // If is_lazily_parsed, we'll parse lazy. If we can set a bookmark, we'll | 4435 // If is_lazily_parsed, we'll parse lazy. If we can set a bookmark, we'll |
4381 // pass it to SkipLazyFunctionBody, which may use it to abort lazy | 4436 // pass it to SkipLazyFunctionBody, which may use it to abort lazy |
4382 // parsing if it suspect that wasn't a good idea. If so, or if we didn't | 4437 // parsing if it suspect that wasn't a good idea. If so, or if we didn't |
4383 // try to lazy parse in the first place, we'll have to parse eagerly. | 4438 // try to lazy parse in the first place, we'll have to parse eagerly. |
4384 Scanner::BookmarkScope bookmark(scanner()); | 4439 Scanner::BookmarkScope bookmark(scanner()); |
4385 if (is_lazily_parsed) { | 4440 if (is_lazily_parsed) { |
4386 Scanner::BookmarkScope* maybe_bookmark = | 4441 Scanner::BookmarkScope* maybe_bookmark = |
4387 bookmark.Set() ? &bookmark : nullptr; | 4442 bookmark.Set() ? &bookmark : nullptr; |
4388 SkipLazyFunctionBody(&materialized_literal_count, | 4443 SkipLazyFunctionBody(&materialized_literal_count, |
4389 &expected_property_count, /*CHECK_OK*/ ok, | 4444 &expected_property_count, /*CHECK_OK*/ ok, |
4390 maybe_bookmark); | 4445 maybe_bookmark); |
4391 | 4446 |
4392 materialized_literal_count += formals.materialized_literals_count + | 4447 materialized_literal_count += formals.materialized_literals_count + |
4393 function_state.materialized_literal_count(); | 4448 function_state.materialized_literal_count(); |
4394 | 4449 |
4395 if (bookmark.HasBeenReset()) { | 4450 if (bookmark.HasBeenReset()) { |
4396 // Trigger eager (re-)parsing, just below this block. | 4451 // Trigger eager (re-)parsing, just below this block. |
4397 is_lazily_parsed = false; | 4452 is_lazily_parsed = false; |
4398 | 4453 |
4399 // This is probably an initialization function. Inform the compiler it | 4454 // This is probably an initialization function. Inform the compiler it |
4400 // should also eager-compile this function, and that we expect it to be | 4455 // should also eager-compile this function, and that we expect it to be |
4401 // used once. | 4456 // used once. |
4402 eager_compile_hint = FunctionLiteral::kShouldEagerCompile; | 4457 eager_compile_hint = FunctionLiteral::kShouldEagerCompile; |
4403 should_be_used_once_hint = true; | 4458 should_be_used_once_hint = true; |
4404 } | 4459 } |
4405 } | 4460 } |
4406 if (!is_lazily_parsed) { | 4461 if (!is_lazily_parsed) { |
4407 // Determine whether the function body can be discarded after parsing. | 4462 body = ParseEagerFunctionBody(function_name, pos, formals, kind, |
4408 // The preconditions are: | 4463 function_type, CHECK_OK); |
4409 // - Lazy compilation has to be enabled. | 4464 |
4410 // - Neither V8 natives nor native function declarations can be allowed, | |
4411 // since parsing one would retroactively force the function to be | |
4412 // eagerly compiled. | |
4413 // - The invoker of this parser can't depend on the AST being eagerly | |
4414 // built (either because the function is about to be compiled, or | |
4415 // because the AST is going to be inspected for some reason). | |
4416 // - Because of the above, we can't be attempting to parse a | |
4417 // FunctionExpression; even without enclosing parentheses it might be | |
4418 // immediately invoked. | |
4419 // - The function literal shouldn't be hinted to eagerly compile. | |
4420 // - For asm.js functions the body needs to be available when module | |
4421 // validation is active, because we examine the entire module at once. | |
4422 bool use_temp_zone = | |
4423 FLAG_lazy && !allow_natives() && extension_ == NULL && allow_lazy() && | |
4424 function_type == FunctionLiteral::kDeclaration && | |
4425 eager_compile_hint != FunctionLiteral::kShouldEagerCompile && | |
4426 !(FLAG_validate_asm && scope->asm_function()); | |
4427 // Open a new zone scope, which sets our AstNodeFactory to allocate in the | |
4428 // new temporary zone if the preconditions are satisfied, and ensures that | |
4429 // the previous zone is always restored after parsing the body. | |
4430 // For the purpose of scope analysis, some ZoneObjects allocated by the | |
4431 // factory must persist after the function body is thrown away and | |
4432 // temp_zone is deallocated. These objects are instead allocated in a | |
4433 // parser-persistent zone (see parser_zone_ in AstNodeFactory). | |
4434 { | |
4435 Zone temp_zone(zone()->allocator()); | |
4436 DiscardableZoneScope zone_scope(this, &temp_zone, use_temp_zone); | |
4437 body = ParseEagerFunctionBody(function_name, pos, formals, kind, | |
4438 function_type, CHECK_OK); | |
4439 } | |
4440 materialized_literal_count = function_state.materialized_literal_count(); | 4465 materialized_literal_count = function_state.materialized_literal_count(); |
4441 expected_property_count = function_state.expected_property_count(); | 4466 expected_property_count = function_state.expected_property_count(); |
4442 if (use_temp_zone) { | 4467 if (use_temp_zone) { |
4443 // If the preconditions are correct the function body should never be | 4468 // If the preconditions are correct the function body should never be |
4444 // accessed, but do this anyway for better behaviour if they're wrong. | 4469 // accessed, but do this anyway for better behaviour if they're wrong. |
4445 body = NULL; | 4470 body = nullptr; |
4446 } | 4471 } |
4447 } | 4472 } |
4448 | 4473 |
4449 // Parsing the body may change the language mode in our scope. | 4474 // Parsing the body may change the language mode in our scope. |
4450 language_mode = scope->language_mode(); | 4475 language_mode = scope->language_mode(); |
4451 | 4476 |
4452 // Validate name and parameter names. We can do this only after parsing the | 4477 // Validate name and parameter names. We can do this only after parsing the |
4453 // function, since the function can declare itself strict. | 4478 // function, since the function can declare itself strict. |
4454 CheckFunctionName(language_mode, function_name, function_name_validity, | 4479 CheckFunctionName(language_mode, function_name, function_name_validity, |
4455 function_name_location, CHECK_OK); | 4480 function_name_location, CHECK_OK); |
4456 const bool allow_duplicate_parameters = | 4481 const bool allow_duplicate_parameters = |
4457 is_sloppy(language_mode) && formals.is_simple && !IsConciseMethod(kind); | 4482 is_sloppy(language_mode) && formals.is_simple && !IsConciseMethod(kind); |
4458 ValidateFormalParameters(&formals_classifier, language_mode, | 4483 ValidateFormalParameters(&formals_classifier, language_mode, |
4459 allow_duplicate_parameters, CHECK_OK); | 4484 allow_duplicate_parameters, CHECK_OK); |
4460 | 4485 |
4461 if (is_strict(language_mode)) { | 4486 if (is_strict(language_mode)) { |
4462 CheckStrictOctalLiteral(scope->start_position(), scope->end_position(), | 4487 CheckStrictOctalLiteral(scope->start_position(), scope->end_position(), |
4463 CHECK_OK); | 4488 CHECK_OK); |
4464 CheckDecimalLiteralWithLeadingZero(use_counts_, scope->start_position(), | 4489 CheckDecimalLiteralWithLeadingZero(use_counts_, scope->start_position(), |
4465 scope->end_position()); | 4490 scope->end_position()); |
4466 } | 4491 } |
4467 CheckConflictingVarDeclarations(scope, CHECK_OK); | 4492 CheckConflictingVarDeclarations(scope, CHECK_OK); |
4468 | 4493 |
4469 if (body) { | 4494 if (body) { |
4470 // If body can be inspected, rewrite queued destructuring assignments | 4495 // If body can be inspected, rewrite queued destructuring assignments |
4471 ParserTraits::RewriteDestructuringAssignments(); | 4496 ParserTraits::RewriteDestructuringAssignments(); |
4472 } | 4497 } |
4473 has_duplicate_parameters = | 4498 has_duplicate_parameters = |
4474 !formals_classifier.is_valid_formal_parameter_list_without_duplicates(); | 4499 !formals_classifier.is_valid_formal_parameter_list_without_duplicates(); |
4475 } | 4500 |
| 4501 if (use_temp_zone) { |
| 4502 DCHECK(main_scope != scope); |
| 4503 scope->AnalyzePartially(main_scope, &previous_zone_ast_node_factory); |
| 4504 } |
| 4505 } // DiscardableZoneScope goes out of scope. |
4476 | 4506 |
4477 FunctionLiteral::ParameterFlag duplicate_parameters = | 4507 FunctionLiteral::ParameterFlag duplicate_parameters = |
4478 has_duplicate_parameters ? FunctionLiteral::kHasDuplicateParameters | 4508 has_duplicate_parameters ? FunctionLiteral::kHasDuplicateParameters |
4479 : FunctionLiteral::kNoDuplicateParameters; | 4509 : FunctionLiteral::kNoDuplicateParameters; |
4480 | 4510 |
| 4511 // Note that the FunctionLiteral needs to be created in the main Zone again. |
4481 FunctionLiteral* function_literal = factory()->NewFunctionLiteral( | 4512 FunctionLiteral* function_literal = factory()->NewFunctionLiteral( |
4482 function_name, scope, body, materialized_literal_count, | 4513 function_name, main_scope, body, materialized_literal_count, |
4483 expected_property_count, arity, duplicate_parameters, function_type, | 4514 expected_property_count, arity, duplicate_parameters, function_type, |
4484 eager_compile_hint, kind, pos); | 4515 eager_compile_hint, kind, pos); |
4485 function_literal->set_function_token_position(function_token_pos); | 4516 function_literal->set_function_token_position(function_token_pos); |
4486 if (should_be_used_once_hint) | 4517 if (should_be_used_once_hint) |
4487 function_literal->set_should_be_used_once_hint(); | 4518 function_literal->set_should_be_used_once_hint(); |
4488 | 4519 |
4489 if (fni_ != NULL && should_infer_name) fni_->AddFunction(function_literal); | 4520 if (fni_ != NULL && should_infer_name) fni_->AddFunction(function_literal); |
4490 return function_literal; | 4521 return function_literal; |
4491 } | 4522 } |
4492 | 4523 |
(...skipping 2598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7091 node->Print(Isolate::Current()); | 7122 node->Print(Isolate::Current()); |
7092 } | 7123 } |
7093 #endif // DEBUG | 7124 #endif // DEBUG |
7094 | 7125 |
7095 #undef CHECK_OK | 7126 #undef CHECK_OK |
7096 #undef CHECK_OK_VOID | 7127 #undef CHECK_OK_VOID |
7097 #undef CHECK_FAILED | 7128 #undef CHECK_FAILED |
7098 | 7129 |
7099 } // namespace internal | 7130 } // namespace internal |
7100 } // namespace v8 | 7131 } // namespace v8 |
OLD | NEW |