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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/ast.h" | 8 #include "src/ast.h" |
9 #include "src/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
(...skipping 3820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3831 } | 3831 } |
3832 } | 3832 } |
3833 | 3833 |
3834 FunctionLiteral* function_literal = factory()->NewFunctionLiteral( | 3834 FunctionLiteral* function_literal = factory()->NewFunctionLiteral( |
3835 function_name, ast_value_factory(), scope, body, | 3835 function_name, ast_value_factory(), scope, body, |
3836 materialized_literal_count, expected_property_count, handler_count, | 3836 materialized_literal_count, expected_property_count, handler_count, |
3837 num_parameters, duplicate_parameters, function_type, | 3837 num_parameters, duplicate_parameters, function_type, |
3838 FunctionLiteral::kIsFunction, parenthesized, kind, pos); | 3838 FunctionLiteral::kIsFunction, parenthesized, kind, pos); |
3839 function_literal->set_function_token_position(function_token_pos); | 3839 function_literal->set_function_token_position(function_token_pos); |
3840 | 3840 |
| 3841 if (scope->has_rest_parameter()) { |
| 3842 // TODO(caitp): enable optimization of functions with rest params |
| 3843 function_literal->set_dont_optimize_reason(kRestParameter); |
| 3844 } |
| 3845 |
3841 if (fni_ != NULL && should_infer_name) fni_->AddFunction(function_literal); | 3846 if (fni_ != NULL && should_infer_name) fni_->AddFunction(function_literal); |
3842 return function_literal; | 3847 return function_literal; |
3843 } | 3848 } |
3844 | 3849 |
3845 | 3850 |
3846 void Parser::SkipLazyFunctionBody(const AstRawString* function_name, | 3851 void Parser::SkipLazyFunctionBody(const AstRawString* function_name, |
3847 int* materialized_literal_count, | 3852 int* materialized_literal_count, |
3848 int* expected_property_count, | 3853 int* expected_property_count, |
3849 bool* ok) { | 3854 bool* ok) { |
3850 if (produce_cached_parse_data()) CHECK(log_); | 3855 if (produce_cached_parse_data()) CHECK(log_); |
(...skipping 1612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5463 } else { | 5468 } else { |
5464 const uc16* data = reinterpret_cast<const uc16*>(raw_string->raw_data()); | 5469 const uc16* data = reinterpret_cast<const uc16*>(raw_string->raw_data()); |
5465 running_hash = StringHasher::ComputeRunningHash(running_hash, data, | 5470 running_hash = StringHasher::ComputeRunningHash(running_hash, data, |
5466 raw_string->length()); | 5471 raw_string->length()); |
5467 } | 5472 } |
5468 } | 5473 } |
5469 | 5474 |
5470 return running_hash; | 5475 return running_hash; |
5471 } | 5476 } |
5472 } } // namespace v8::internal | 5477 } } // namespace v8::internal |
OLD | NEW |