Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: src/preparser.h

Issue 527763002: Refactor Parser to make it usable on a background thread. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: whitespace Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/parser.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef V8_PREPARSER_H 5 #ifndef V8_PREPARSER_H
6 #define V8_PREPARSER_H 6 #define V8_PREPARSER_H
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/func-name-inferrer.h" 10 #include "src/func-name-inferrer.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 AstNode::IdGen* ast_node_id_gen, 71 AstNode::IdGen* ast_node_id_gen,
72 typename Traits::Type::Parser this_object) 72 typename Traits::Type::Parser this_object)
73 : Traits(this_object), 73 : Traits(this_object),
74 parenthesized_function_(false), 74 parenthesized_function_(false),
75 scope_(NULL), 75 scope_(NULL),
76 function_state_(NULL), 76 function_state_(NULL),
77 extension_(extension), 77 extension_(extension),
78 fni_(NULL), 78 fni_(NULL),
79 log_(log), 79 log_(log),
80 mode_(PARSE_EAGERLY), // Lazy mode must be set explicitly. 80 mode_(PARSE_EAGERLY), // Lazy mode must be set explicitly.
81 stack_limit_(stack_limit),
81 scanner_(scanner), 82 scanner_(scanner),
82 stack_limit_(stack_limit),
83 stack_overflow_(false), 83 stack_overflow_(false),
84 allow_lazy_(false), 84 allow_lazy_(false),
85 allow_natives_syntax_(false), 85 allow_natives_syntax_(false),
86 allow_generators_(false), 86 allow_generators_(false),
87 allow_arrow_functions_(false), 87 allow_arrow_functions_(false),
88 zone_(zone), 88 zone_(zone),
89 ast_node_id_gen_(ast_node_id_gen) {} 89 ast_node_id_gen_(ast_node_id_gen) {}
90 90
91 // Getters that indicate whether certain syntactical constructs are 91 // Getters that indicate whether certain syntactical constructs are
92 // allowed to be parsed by this instance of the parser. 92 // allowed to be parsed by this instance of the parser.
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 // Heuristically that means that the function will be called immediately, 562 // Heuristically that means that the function will be called immediately,
563 // so never lazily compile it. 563 // so never lazily compile it.
564 bool parenthesized_function_; 564 bool parenthesized_function_;
565 565
566 typename Traits::Type::Scope* scope_; // Scope stack. 566 typename Traits::Type::Scope* scope_; // Scope stack.
567 FunctionState* function_state_; // Function state stack. 567 FunctionState* function_state_; // Function state stack.
568 v8::Extension* extension_; 568 v8::Extension* extension_;
569 FuncNameInferrer* fni_; 569 FuncNameInferrer* fni_;
570 ParserRecorder* log_; 570 ParserRecorder* log_;
571 Mode mode_; 571 Mode mode_;
572 uintptr_t stack_limit_;
572 573
573 private: 574 private:
574 Scanner* scanner_; 575 Scanner* scanner_;
575 uintptr_t stack_limit_;
576 bool stack_overflow_; 576 bool stack_overflow_;
577 577
578 bool allow_lazy_; 578 bool allow_lazy_;
579 bool allow_natives_syntax_; 579 bool allow_natives_syntax_;
580 bool allow_generators_; 580 bool allow_generators_;
581 bool allow_arrow_functions_; 581 bool allow_arrow_functions_;
582 582
583 typename Traits::Type::Zone* zone_; // Only used by Parser. 583 typename Traits::Type::Zone* zone_; // Only used by Parser.
584 AstNode::IdGen* ast_node_id_gen_; 584 AstNode::IdGen* ast_node_id_gen_;
585 }; 585 };
(...skipping 2075 matching lines...) Expand 10 before | Expand all | Expand 10 after
2661 DCHECK(IsAccessorAccessorConflict(old_type, type)); 2661 DCHECK(IsAccessorAccessorConflict(old_type, type));
2662 // Both accessors of the same type. 2662 // Both accessors of the same type.
2663 parser()->ReportMessage("accessor_get_set"); 2663 parser()->ReportMessage("accessor_get_set");
2664 } 2664 }
2665 *ok = false; 2665 *ok = false;
2666 } 2666 }
2667 } 2667 }
2668 } } // v8::internal 2668 } } // v8::internal
2669 2669
2670 #endif // V8_PREPARSER_H 2670 #endif // V8_PREPARSER_H
OLDNEW
« no previous file with comments | « src/parser.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698