Chromium Code Reviews| Index: src/parsing/parser-base.h |
| diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h |
| index 524b76652858d14f569ab8d06a29b9c0ffd3269f..e7e18aec2eb93975c0c4217065daa940253d3fbf 100644 |
| --- a/src/parsing/parser-base.h |
| +++ b/src/parsing/parser-base.h |
| @@ -198,7 +198,6 @@ class ParserBase { |
| fni_(nullptr), |
| ast_value_factory_(ast_value_factory), |
| ast_node_factory_(ast_value_factory), |
| - mode_(PARSE_EAGERLY), // Lazy mode must be set explicitly. |
| parsing_module_(false), |
| stack_limit_(stack_limit), |
| zone_(zone), |
| @@ -591,22 +590,6 @@ class ParserBase { |
| int expected_property_count_; |
| }; |
| - class ParsingModeScope BASE_EMBEDDED { |
| - public: |
| - ParsingModeScope(ParserBase* parser, Mode mode) |
| - : parser_(parser), |
| - old_mode_(parser->mode()) { |
| - parser_->mode_ = mode; |
| - } |
| - ~ParsingModeScope() { |
| - parser_->mode_ = old_mode_; |
| - } |
| - |
| - private: |
| - ParserBase* parser_; |
| - Mode old_mode_; |
| - }; |
| - |
| struct DeclarationDescriptor { |
| enum Kind { NORMAL, PARAMETER }; |
| Scope* scope; |
| @@ -753,7 +736,6 @@ class ParserBase { |
| int peek_position() const { return scanner_->peek_location().beg_pos; } |
| bool stack_overflow() const { return stack_overflow_; } |
| void set_stack_overflow() { stack_overflow_ = true; } |
| - Mode mode() const { return mode_; } |
| INLINE(Token::Value peek()) { |
| if (stack_overflow_) return Token::ILLEGAL; |
| @@ -1440,7 +1422,6 @@ class ParserBase { |
| FuncNameInferrer* fni_; |
| AstValueFactory* ast_value_factory_; // Not owned. |
| typename Types::Factory ast_node_factory_; |
| - Mode mode_; |
| bool parsing_module_; |
| uintptr_t stack_limit_; |
| @@ -3924,7 +3905,7 @@ ParserBase<Impl>::ParseArrowFunctionLiteral( |
| FunctionKind kind = formal_parameters.scope->function_kind(); |
| FunctionLiteral::EagerCompileHint eager_compile_hint = |
| default_eager_compile_hint_; |
| - bool can_preparse = mode() == PARSE_LAZILY && |
| + bool can_preparse = impl()->mode() == PARSE_LAZILY && |
| eager_compile_hint == FunctionLiteral::kShouldLazyCompile; |
| // TODO(marja): consider lazy-parsing inner arrow functions too. is_this |
| // handling in Scope::ResolveVariable needs to change. |
| @@ -4405,11 +4386,6 @@ ParserBase<Impl>::ParseStatementList(StatementListT body, int end_token, |
| *ok = false; |
| return kLazyParsingComplete; |
| } |
| - // Because declarations in strict eval code don't leak into the scope |
| - // of the eval call, it is likely that functions declared in strict |
| - // eval code will be used within the eval code, so lazy parsing is |
| - // probably not a win. |
| - if (scope()->is_eval_scope()) mode_ = PARSE_EAGERLY; |
|
Toon Verwaest
2016/11/07 14:38:13
There is no equivalent in the new version. We're t
vogelheim
2016/11/07 14:56:17
Thanks for the comment; I wouldn't have understood
|
| } else if (impl()->IsUseAsmDirective(stat) && |
| token_loc.end_pos - token_loc.beg_pos == |
| sizeof("use asm") + 1) { |