| 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 function_scope->SetLanguageMode( | 291 function_scope->SetLanguageMode( |
| 292 static_cast<LanguageMode>(scope->language_mode() | STRICT)); | 292 static_cast<LanguageMode>(scope->language_mode() | STRICT)); |
| 293 // Set start and end position to the same value | 293 // Set start and end position to the same value |
| 294 function_scope->set_start_position(pos); | 294 function_scope->set_start_position(pos); |
| 295 function_scope->set_end_position(pos); | 295 function_scope->set_end_position(pos); |
| 296 ZoneList<Statement*>* body = NULL; | 296 ZoneList<Statement*>* body = NULL; |
| 297 | 297 |
| 298 { | 298 { |
| 299 AstNodeFactory function_factory(ast_value_factory()); | 299 AstNodeFactory function_factory(ast_value_factory()); |
| 300 FunctionState function_state(&function_state_, &scope_, function_scope, | 300 FunctionState function_state(&function_state_, &scope_, function_scope, |
| 301 &function_factory); | 301 kDefaultConstructor, &function_factory); |
| 302 | 302 |
| 303 body = new (zone()) ZoneList<Statement*>(1, zone()); | 303 body = new (zone()) ZoneList<Statement*>(1, zone()); |
| 304 if (call_super) { | 304 if (call_super) { |
| 305 ZoneList<Expression*>* args = | 305 ZoneList<Expression*>* args = |
| 306 new (zone()) ZoneList<Expression*>(0, zone()); | 306 new (zone()) ZoneList<Expression*>(0, zone()); |
| 307 CallRuntime* call = factory()->NewCallRuntime( | 307 CallRuntime* call = factory()->NewCallRuntime( |
| 308 ast_value_factory()->empty_string(), | 308 ast_value_factory()->empty_string(), |
| 309 Runtime::FunctionForId(Runtime::kDefaultConstructorSuperCall), args, | 309 Runtime::FunctionForId(Runtime::kDefaultConstructorSuperCall), args, |
| 310 pos); | 310 pos); |
| 311 body->Add(factory()->NewExpressionStatement(call, pos), zone()); | 311 body->Add(factory()->NewExpressionStatement(call, pos), zone()); |
| (...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 Mode mode = (FLAG_lazy && allow_lazy()) ? PARSE_LAZILY : PARSE_EAGERLY; | 938 Mode mode = (FLAG_lazy && allow_lazy()) ? PARSE_LAZILY : PARSE_EAGERLY; |
| 939 if (allow_natives() || extension_ != NULL || | 939 if (allow_natives() || extension_ != NULL || |
| 940 (*scope)->is_eval_scope()) { | 940 (*scope)->is_eval_scope()) { |
| 941 mode = PARSE_EAGERLY; | 941 mode = PARSE_EAGERLY; |
| 942 } | 942 } |
| 943 ParsingModeScope parsing_mode(this, mode); | 943 ParsingModeScope parsing_mode(this, mode); |
| 944 | 944 |
| 945 // Enters 'scope'. | 945 // Enters 'scope'. |
| 946 AstNodeFactory function_factory(ast_value_factory()); | 946 AstNodeFactory function_factory(ast_value_factory()); |
| 947 FunctionState function_state(&function_state_, &scope_, *scope, | 947 FunctionState function_state(&function_state_, &scope_, *scope, |
| 948 &function_factory); | 948 kNormalFunction, &function_factory); |
| 949 | 949 |
| 950 scope_->SetLanguageMode(info->language_mode()); | 950 scope_->SetLanguageMode(info->language_mode()); |
| 951 ZoneList<Statement*>* body = new(zone()) ZoneList<Statement*>(16, zone()); | 951 ZoneList<Statement*>* body = new(zone()) ZoneList<Statement*>(16, zone()); |
| 952 bool ok = true; | 952 bool ok = true; |
| 953 int beg_pos = scanner()->location().beg_pos; | 953 int beg_pos = scanner()->location().beg_pos; |
| 954 if (info->is_module()) { | 954 if (info->is_module()) { |
| 955 DCHECK(allow_harmony_modules()); | 955 DCHECK(allow_harmony_modules()); |
| 956 Module* module = ParseModule(&ok); | 956 Module* module = ParseModule(&ok); |
| 957 if (ok) { | 957 if (ok) { |
| 958 // TODO(adamk): Do something with returned Module | 958 // TODO(adamk): Do something with returned Module |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1058 // Parse the function literal. | 1058 // Parse the function literal. |
| 1059 Scope* scope = NewScope(scope_, SCRIPT_SCOPE); | 1059 Scope* scope = NewScope(scope_, SCRIPT_SCOPE); |
| 1060 info()->SetScriptScope(scope); | 1060 info()->SetScriptScope(scope); |
| 1061 if (!info()->closure().is_null()) { | 1061 if (!info()->closure().is_null()) { |
| 1062 scope = Scope::DeserializeScopeChain(isolate(), zone(), | 1062 scope = Scope::DeserializeScopeChain(isolate(), zone(), |
| 1063 info()->closure()->context(), scope); | 1063 info()->closure()->context(), scope); |
| 1064 } | 1064 } |
| 1065 original_scope_ = scope; | 1065 original_scope_ = scope; |
| 1066 AstNodeFactory function_factory(ast_value_factory()); | 1066 AstNodeFactory function_factory(ast_value_factory()); |
| 1067 FunctionState function_state(&function_state_, &scope_, scope, | 1067 FunctionState function_state(&function_state_, &scope_, scope, |
| 1068 &function_factory); | 1068 shared_info->kind(), &function_factory); |
| 1069 DCHECK(is_sloppy(scope->language_mode()) || | 1069 DCHECK(is_sloppy(scope->language_mode()) || |
| 1070 is_strict(info()->language_mode())); | 1070 is_strict(info()->language_mode())); |
| 1071 DCHECK(info()->language_mode() == shared_info->language_mode()); | 1071 DCHECK(info()->language_mode() == shared_info->language_mode()); |
| 1072 scope->SetLanguageMode(shared_info->language_mode()); | 1072 scope->SetLanguageMode(shared_info->language_mode()); |
| 1073 FunctionLiteral::FunctionType function_type = shared_info->is_expression() | 1073 FunctionLiteral::FunctionType function_type = shared_info->is_expression() |
| 1074 ? (shared_info->is_anonymous() | 1074 ? (shared_info->is_anonymous() |
| 1075 ? FunctionLiteral::ANONYMOUS_EXPRESSION | 1075 ? FunctionLiteral::ANONYMOUS_EXPRESSION |
| 1076 : FunctionLiteral::NAMED_EXPRESSION) | 1076 : FunctionLiteral::NAMED_EXPRESSION) |
| 1077 : FunctionLiteral::DECLARATION; | 1077 : FunctionLiteral::DECLARATION; |
| 1078 bool ok = true; | 1078 bool ok = true; |
| (...skipping 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2628 Expect(Token::RETURN, CHECK_OK); | 2628 Expect(Token::RETURN, CHECK_OK); |
| 2629 Scanner::Location loc = scanner()->location(); | 2629 Scanner::Location loc = scanner()->location(); |
| 2630 | 2630 |
| 2631 Token::Value tok = peek(); | 2631 Token::Value tok = peek(); |
| 2632 Statement* result; | 2632 Statement* result; |
| 2633 Expression* return_value; | 2633 Expression* return_value; |
| 2634 if (scanner()->HasAnyLineTerminatorBeforeNext() || | 2634 if (scanner()->HasAnyLineTerminatorBeforeNext() || |
| 2635 tok == Token::SEMICOLON || | 2635 tok == Token::SEMICOLON || |
| 2636 tok == Token::RBRACE || | 2636 tok == Token::RBRACE || |
| 2637 tok == Token::EOS) { | 2637 tok == Token::EOS) { |
| 2638 return_value = GetLiteralUndefined(position()); | 2638 if (FLAG_experimental_classes && |
| 2639 IsSubclassConstructor(function_state_->kind())) { |
| 2640 return_value = ThisExpression(scope_, factory(), loc.beg_pos); |
| 2641 } else { |
| 2642 return_value = GetLiteralUndefined(position()); |
| 2643 } |
| 2639 } else { | 2644 } else { |
| 2640 return_value = ParseExpression(true, CHECK_OK); | 2645 return_value = ParseExpression(true, CHECK_OK); |
| 2641 } | 2646 } |
| 2642 ExpectSemicolon(CHECK_OK); | 2647 ExpectSemicolon(CHECK_OK); |
| 2648 |
| 2643 if (is_generator()) { | 2649 if (is_generator()) { |
| 2644 Expression* generator = factory()->NewVariableProxy( | 2650 Expression* generator = factory()->NewVariableProxy( |
| 2645 function_state_->generator_object_variable()); | 2651 function_state_->generator_object_variable()); |
| 2646 Expression* yield = factory()->NewYield( | 2652 Expression* yield = factory()->NewYield( |
| 2647 generator, return_value, Yield::kFinal, loc.beg_pos); | 2653 generator, return_value, Yield::kFinal, loc.beg_pos); |
| 2648 result = factory()->NewExpressionStatement(yield, loc.beg_pos); | 2654 result = factory()->NewExpressionStatement(yield, loc.beg_pos); |
| 2649 } else { | 2655 } else { |
| 2650 result = factory()->NewReturnStatement(return_value, loc.beg_pos); | 2656 result = factory()->NewReturnStatement(return_value, loc.beg_pos); |
| 2651 } | 2657 } |
| 2652 | 2658 |
| (...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3649 int expected_property_count = -1; | 3655 int expected_property_count = -1; |
| 3650 int handler_count = 0; | 3656 int handler_count = 0; |
| 3651 FunctionLiteral::ParameterFlag duplicate_parameters = | 3657 FunctionLiteral::ParameterFlag duplicate_parameters = |
| 3652 FunctionLiteral::kNoDuplicateParameters; | 3658 FunctionLiteral::kNoDuplicateParameters; |
| 3653 FunctionLiteral::IsParenthesizedFlag parenthesized = parenthesized_function_ | 3659 FunctionLiteral::IsParenthesizedFlag parenthesized = parenthesized_function_ |
| 3654 ? FunctionLiteral::kIsParenthesized | 3660 ? FunctionLiteral::kIsParenthesized |
| 3655 : FunctionLiteral::kNotParenthesized; | 3661 : FunctionLiteral::kNotParenthesized; |
| 3656 // Parse function body. | 3662 // Parse function body. |
| 3657 { | 3663 { |
| 3658 AstNodeFactory function_factory(ast_value_factory()); | 3664 AstNodeFactory function_factory(ast_value_factory()); |
| 3659 FunctionState function_state(&function_state_, &scope_, scope, | 3665 FunctionState function_state(&function_state_, &scope_, scope, kind, |
| 3660 &function_factory); | 3666 &function_factory); |
| 3661 scope_->SetScopeName(function_name); | 3667 scope_->SetScopeName(function_name); |
| 3662 | 3668 |
| 3663 if (is_generator) { | 3669 if (is_generator) { |
| 3664 // For generators, allocating variables in contexts is currently a win | 3670 // For generators, allocating variables in contexts is currently a win |
| 3665 // because it minimizes the work needed to suspend and resume an | 3671 // because it minimizes the work needed to suspend and resume an |
| 3666 // activation. | 3672 // activation. |
| 3667 scope_->ForceContextAllocation(); | 3673 scope_->ForceContextAllocation(); |
| 3668 | 3674 |
| 3669 // Calling a generator returns a generator object. That object is stored | 3675 // Calling a generator returns a generator object. That object is stored |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3803 bool is_lazily_parsed = (mode() == PARSE_LAZILY && | 3809 bool is_lazily_parsed = (mode() == PARSE_LAZILY && |
| 3804 scope_->AllowsLazyCompilation() && | 3810 scope_->AllowsLazyCompilation() && |
| 3805 !parenthesized_function_); | 3811 !parenthesized_function_); |
| 3806 parenthesized_function_ = false; // The bit was set for this function only. | 3812 parenthesized_function_ = false; // The bit was set for this function only. |
| 3807 | 3813 |
| 3808 if (is_lazily_parsed) { | 3814 if (is_lazily_parsed) { |
| 3809 SkipLazyFunctionBody(function_name, &materialized_literal_count, | 3815 SkipLazyFunctionBody(function_name, &materialized_literal_count, |
| 3810 &expected_property_count, CHECK_OK); | 3816 &expected_property_count, CHECK_OK); |
| 3811 } else { | 3817 } else { |
| 3812 body = ParseEagerFunctionBody(function_name, pos, fvar, fvar_init_op, | 3818 body = ParseEagerFunctionBody(function_name, pos, fvar, fvar_init_op, |
| 3813 is_generator, CHECK_OK); | 3819 kind, CHECK_OK); |
| 3814 materialized_literal_count = function_state.materialized_literal_count(); | 3820 materialized_literal_count = function_state.materialized_literal_count(); |
| 3815 expected_property_count = function_state.expected_property_count(); | 3821 expected_property_count = function_state.expected_property_count(); |
| 3816 handler_count = function_state.handler_count(); | 3822 handler_count = function_state.handler_count(); |
| 3817 } | 3823 } |
| 3818 | 3824 |
| 3819 // Validate strict mode. | 3825 // Validate strict mode. |
| 3820 // Concise methods use StrictFormalParameters. | 3826 // Concise methods use StrictFormalParameters. |
| 3821 // Functions for which IsSimpleParameterList() returns false use | 3827 // Functions for which IsSimpleParameterList() returns false use |
| 3822 // StrictFormalParameters. | 3828 // StrictFormalParameters. |
| 3823 if (is_strict(language_mode()) || IsConciseMethod(kind) || is_rest) { | 3829 if (is_strict(language_mode()) || IsConciseMethod(kind) || is_rest) { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3913 // Position right after terminal '}'. | 3919 // Position right after terminal '}'. |
| 3914 int body_end = scanner()->location().end_pos; | 3920 int body_end = scanner()->location().end_pos; |
| 3915 log_->LogFunction(function_block_pos, body_end, *materialized_literal_count, | 3921 log_->LogFunction(function_block_pos, body_end, *materialized_literal_count, |
| 3916 *expected_property_count, scope_->language_mode()); | 3922 *expected_property_count, scope_->language_mode()); |
| 3917 } | 3923 } |
| 3918 } | 3924 } |
| 3919 | 3925 |
| 3920 | 3926 |
| 3921 ZoneList<Statement*>* Parser::ParseEagerFunctionBody( | 3927 ZoneList<Statement*>* Parser::ParseEagerFunctionBody( |
| 3922 const AstRawString* function_name, int pos, Variable* fvar, | 3928 const AstRawString* function_name, int pos, Variable* fvar, |
| 3923 Token::Value fvar_init_op, bool is_generator, bool* ok) { | 3929 Token::Value fvar_init_op, FunctionKind kind, bool* ok) { |
| 3924 // Everything inside an eagerly parsed function will be parsed eagerly | 3930 // Everything inside an eagerly parsed function will be parsed eagerly |
| 3925 // (see comment above). | 3931 // (see comment above). |
| 3926 ParsingModeScope parsing_mode(this, PARSE_EAGERLY); | 3932 ParsingModeScope parsing_mode(this, PARSE_EAGERLY); |
| 3927 ZoneList<Statement*>* body = new(zone()) ZoneList<Statement*>(8, zone()); | 3933 ZoneList<Statement*>* body = new(zone()) ZoneList<Statement*>(8, zone()); |
| 3928 if (fvar != NULL) { | 3934 if (fvar != NULL) { |
| 3929 VariableProxy* fproxy = scope_->NewUnresolved( | 3935 VariableProxy* fproxy = scope_->NewUnresolved( |
| 3930 factory(), function_name, Interface::NewConst()); | 3936 factory(), function_name, Interface::NewConst()); |
| 3931 fproxy->BindTo(fvar); | 3937 fproxy->BindTo(fvar); |
| 3932 body->Add(factory()->NewExpressionStatement( | 3938 body->Add(factory()->NewExpressionStatement( |
| 3933 factory()->NewAssignment(fvar_init_op, | 3939 factory()->NewAssignment(fvar_init_op, |
| 3934 fproxy, | 3940 fproxy, |
| 3935 factory()->NewThisFunction(pos), | 3941 factory()->NewThisFunction(pos), |
| 3936 RelocInfo::kNoPosition), | 3942 RelocInfo::kNoPosition), |
| 3937 RelocInfo::kNoPosition), zone()); | 3943 RelocInfo::kNoPosition), zone()); |
| 3938 } | 3944 } |
| 3939 | 3945 |
| 3946 |
| 3947 // For concise constructors, check that they are constructed, |
| 3948 // not called. |
| 3949 if (FLAG_experimental_classes && i::IsConstructor(kind)) { |
| 3950 ZoneList<Expression*>* arguments = |
| 3951 new (zone()) ZoneList<Expression*>(0, zone()); |
| 3952 CallRuntime* construct_check = factory()->NewCallRuntime( |
| 3953 ast_value_factory()->is_construct_call_string(), |
| 3954 Runtime::FunctionForId(Runtime::kInlineIsConstructCall), arguments, |
| 3955 pos); |
| 3956 CallRuntime* non_callable_error = factory()->NewCallRuntime( |
| 3957 ast_value_factory()->empty_string(), |
| 3958 Runtime::FunctionForId(Runtime::kThrowConstructorNonCallableError), |
| 3959 arguments, pos); |
| 3960 IfStatement* if_statement = factory()->NewIfStatement( |
| 3961 factory()->NewUnaryOperation(Token::NOT, construct_check, pos), |
| 3962 factory()->NewReturnStatement(non_callable_error, pos), |
| 3963 factory()->NewEmptyStatement(pos), pos); |
| 3964 body->Add(if_statement, zone()); |
| 3965 } |
| 3966 |
| 3940 // For generators, allocate and yield an iterator on function entry. | 3967 // For generators, allocate and yield an iterator on function entry. |
| 3941 if (is_generator) { | 3968 if (IsGeneratorFunction(kind)) { |
| 3942 ZoneList<Expression*>* arguments = | 3969 ZoneList<Expression*>* arguments = |
| 3943 new(zone()) ZoneList<Expression*>(0, zone()); | 3970 new(zone()) ZoneList<Expression*>(0, zone()); |
| 3944 CallRuntime* allocation = factory()->NewCallRuntime( | 3971 CallRuntime* allocation = factory()->NewCallRuntime( |
| 3945 ast_value_factory()->empty_string(), | 3972 ast_value_factory()->empty_string(), |
| 3946 Runtime::FunctionForId(Runtime::kCreateJSGeneratorObject), arguments, | 3973 Runtime::FunctionForId(Runtime::kCreateJSGeneratorObject), arguments, |
| 3947 pos); | 3974 pos); |
| 3948 VariableProxy* init_proxy = factory()->NewVariableProxy( | 3975 VariableProxy* init_proxy = factory()->NewVariableProxy( |
| 3949 function_state_->generator_object_variable()); | 3976 function_state_->generator_object_variable()); |
| 3950 Assignment* assignment = factory()->NewAssignment( | 3977 Assignment* assignment = factory()->NewAssignment( |
| 3951 Token::INIT_VAR, init_proxy, allocation, RelocInfo::kNoPosition); | 3978 Token::INIT_VAR, init_proxy, allocation, RelocInfo::kNoPosition); |
| 3952 VariableProxy* get_proxy = factory()->NewVariableProxy( | 3979 VariableProxy* get_proxy = factory()->NewVariableProxy( |
| 3953 function_state_->generator_object_variable()); | 3980 function_state_->generator_object_variable()); |
| 3954 Yield* yield = factory()->NewYield( | 3981 Yield* yield = factory()->NewYield( |
| 3955 get_proxy, assignment, Yield::kInitial, RelocInfo::kNoPosition); | 3982 get_proxy, assignment, Yield::kInitial, RelocInfo::kNoPosition); |
| 3956 body->Add(factory()->NewExpressionStatement( | 3983 body->Add(factory()->NewExpressionStatement( |
| 3957 yield, RelocInfo::kNoPosition), zone()); | 3984 yield, RelocInfo::kNoPosition), zone()); |
| 3958 } | 3985 } |
| 3959 | 3986 |
| 3960 ParseStatementList(body, Token::RBRACE, false, NULL, CHECK_OK); | 3987 ParseStatementList(body, Token::RBRACE, false, NULL, CHECK_OK); |
| 3961 | 3988 |
| 3962 if (is_generator) { | 3989 if (IsGeneratorFunction(kind)) { |
| 3963 VariableProxy* get_proxy = factory()->NewVariableProxy( | 3990 VariableProxy* get_proxy = factory()->NewVariableProxy( |
| 3964 function_state_->generator_object_variable()); | 3991 function_state_->generator_object_variable()); |
| 3965 Expression* undefined = | 3992 Expression* undefined = |
| 3966 factory()->NewUndefinedLiteral(RelocInfo::kNoPosition); | 3993 factory()->NewUndefinedLiteral(RelocInfo::kNoPosition); |
| 3967 Yield* yield = factory()->NewYield(get_proxy, undefined, Yield::kFinal, | 3994 Yield* yield = factory()->NewYield(get_proxy, undefined, Yield::kFinal, |
| 3968 RelocInfo::kNoPosition); | 3995 RelocInfo::kNoPosition); |
| 3969 body->Add(factory()->NewExpressionStatement( | 3996 body->Add(factory()->NewExpressionStatement( |
| 3970 yield, RelocInfo::kNoPosition), zone()); | 3997 yield, RelocInfo::kNoPosition), zone()); |
| 3971 } | 3998 } |
| 3972 | 3999 |
| 4000 if (FLAG_experimental_classes && IsSubclassConstructor(kind)) { |
| 4001 body->Add( |
| 4002 factory()->NewReturnStatement( |
| 4003 this->ThisExpression(scope_, factory(), RelocInfo::kNoPosition), |
| 4004 RelocInfo::kNoPosition), |
| 4005 zone()); |
| 4006 } |
| 4007 |
| 3973 Expect(Token::RBRACE, CHECK_OK); | 4008 Expect(Token::RBRACE, CHECK_OK); |
| 3974 scope_->set_end_position(scanner()->location().end_pos); | 4009 scope_->set_end_position(scanner()->location().end_pos); |
| 3975 | 4010 |
| 3976 return body; | 4011 return body; |
| 3977 } | 4012 } |
| 3978 | 4013 |
| 3979 | 4014 |
| 3980 PreParser::PreParseResult Parser::ParseLazyFunctionBodyWithPreParser( | 4015 PreParser::PreParseResult Parser::ParseLazyFunctionBodyWithPreParser( |
| 3981 SingletonLogger* logger) { | 4016 SingletonLogger* logger) { |
| 3982 // This function may be called on a background thread too; record only the | 4017 // This function may be called on a background thread too; record only the |
| (...skipping 19 matching lines...) Expand all Loading... |
| 4002 allow_harmony_object_literals()); | 4037 allow_harmony_object_literals()); |
| 4003 reusable_preparser_->set_allow_harmony_templates(allow_harmony_templates()); | 4038 reusable_preparser_->set_allow_harmony_templates(allow_harmony_templates()); |
| 4004 reusable_preparser_->set_allow_harmony_sloppy(allow_harmony_sloppy()); | 4039 reusable_preparser_->set_allow_harmony_sloppy(allow_harmony_sloppy()); |
| 4005 reusable_preparser_->set_allow_harmony_unicode(allow_harmony_unicode()); | 4040 reusable_preparser_->set_allow_harmony_unicode(allow_harmony_unicode()); |
| 4006 reusable_preparser_->set_allow_harmony_computed_property_names( | 4041 reusable_preparser_->set_allow_harmony_computed_property_names( |
| 4007 allow_harmony_computed_property_names()); | 4042 allow_harmony_computed_property_names()); |
| 4008 reusable_preparser_->set_allow_harmony_rest_params( | 4043 reusable_preparser_->set_allow_harmony_rest_params( |
| 4009 allow_harmony_rest_params()); | 4044 allow_harmony_rest_params()); |
| 4010 } | 4045 } |
| 4011 PreParser::PreParseResult result = reusable_preparser_->PreParseLazyFunction( | 4046 PreParser::PreParseResult result = reusable_preparser_->PreParseLazyFunction( |
| 4012 language_mode(), is_generator(), logger); | 4047 language_mode(), function_state_->kind(), logger); |
| 4013 if (pre_parse_timer_ != NULL) { | 4048 if (pre_parse_timer_ != NULL) { |
| 4014 pre_parse_timer_->Stop(); | 4049 pre_parse_timer_->Stop(); |
| 4015 } | 4050 } |
| 4016 return result; | 4051 return result; |
| 4017 } | 4052 } |
| 4018 | 4053 |
| 4019 | 4054 |
| 4020 ClassLiteral* Parser::ParseClassLiteral(const AstRawString* name, | 4055 ClassLiteral* Parser::ParseClassLiteral(const AstRawString* name, |
| 4021 Scanner::Location class_name_location, | 4056 Scanner::Location class_name_location, |
| 4022 bool name_is_strict_reserved, int pos, | 4057 bool name_is_strict_reserved, int pos, |
| (...skipping 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5412 } else { | 5447 } else { |
| 5413 const uc16* data = reinterpret_cast<const uc16*>(raw_string->raw_data()); | 5448 const uc16* data = reinterpret_cast<const uc16*>(raw_string->raw_data()); |
| 5414 running_hash = StringHasher::ComputeRunningHash(running_hash, data, | 5449 running_hash = StringHasher::ComputeRunningHash(running_hash, data, |
| 5415 raw_string->length()); | 5450 raw_string->length()); |
| 5416 } | 5451 } |
| 5417 } | 5452 } |
| 5418 | 5453 |
| 5419 return running_hash; | 5454 return running_hash; |
| 5420 } | 5455 } |
| 5421 } } // namespace v8::internal | 5456 } } // namespace v8::internal |
| OLD | NEW |