| 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 "src/api.h" | 7 #include "src/api.h" |
| 8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
| 9 #include "src/ast/ast-expression-rewriter.h" | 9 #include "src/ast/ast-expression-rewriter.h" |
| 10 #include "src/ast/ast-expression-visitor.h" | 10 #include "src/ast/ast-expression-visitor.h" |
| (...skipping 4382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4393 : FunctionLiteral::kNoDuplicateParameters; | 4393 : FunctionLiteral::kNoDuplicateParameters; |
| 4394 | 4394 |
| 4395 FunctionLiteral* function_literal = factory()->NewFunctionLiteral( | 4395 FunctionLiteral* function_literal = factory()->NewFunctionLiteral( |
| 4396 function_name, scope, body, materialized_literal_count, | 4396 function_name, scope, body, materialized_literal_count, |
| 4397 expected_property_count, arity, duplicate_parameters, function_type, | 4397 expected_property_count, arity, duplicate_parameters, function_type, |
| 4398 eager_compile_hint, kind, pos); | 4398 eager_compile_hint, kind, pos); |
| 4399 function_literal->set_function_token_position(function_token_pos); | 4399 function_literal->set_function_token_position(function_token_pos); |
| 4400 if (should_be_used_once_hint) | 4400 if (should_be_used_once_hint) |
| 4401 function_literal->set_should_be_used_once_hint(); | 4401 function_literal->set_should_be_used_once_hint(); |
| 4402 | 4402 |
| 4403 if (scope->has_rest_parameter()) { | |
| 4404 function_literal->set_dont_optimize_reason(kRestParameter); | |
| 4405 } | |
| 4406 | |
| 4407 if (fni_ != NULL && should_infer_name) fni_->AddFunction(function_literal); | 4403 if (fni_ != NULL && should_infer_name) fni_->AddFunction(function_literal); |
| 4408 return function_literal; | 4404 return function_literal; |
| 4409 } | 4405 } |
| 4410 | 4406 |
| 4411 | 4407 |
| 4412 void Parser::SkipLazyFunctionBody(int* materialized_literal_count, | 4408 void Parser::SkipLazyFunctionBody(int* materialized_literal_count, |
| 4413 int* expected_property_count, bool* ok, | 4409 int* expected_property_count, bool* ok, |
| 4414 Scanner::BookmarkScope* bookmark) { | 4410 Scanner::BookmarkScope* bookmark) { |
| 4415 DCHECK_IMPLIES(bookmark, bookmark->HasBeenSet()); | 4411 DCHECK_IMPLIES(bookmark, bookmark->HasBeenSet()); |
| 4416 if (produce_cached_parse_data()) CHECK(log_); | 4412 if (produce_cached_parse_data()) CHECK(log_); |
| (...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5779 function->set_raw_name(name); | 5775 function->set_raw_name(name); |
| 5780 } else { | 5776 } else { |
| 5781 DCHECK(value->IsClassLiteral()); | 5777 DCHECK(value->IsClassLiteral()); |
| 5782 value->AsClassLiteral()->constructor()->set_raw_name(name); | 5778 value->AsClassLiteral()->constructor()->set_raw_name(name); |
| 5783 } | 5779 } |
| 5784 } | 5780 } |
| 5785 | 5781 |
| 5786 | 5782 |
| 5787 } // namespace internal | 5783 } // namespace internal |
| 5788 } // namespace v8 | 5784 } // namespace v8 |
| OLD | NEW |