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

Side by Side Diff: src/parser.h

Issue 6311005: Don't lazily compile functions that are immediately receded by '('. (Closed)
Patch Set: Created 9 years, 11 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
« no previous file with comments | « no previous file | src/parser.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 TemporaryScope* temp_scope_; 675 TemporaryScope* temp_scope_;
676 Mode mode_; 676 Mode mode_;
677 677
678 Target* target_stack_; // for break, continue statements 678 Target* target_stack_; // for break, continue statements
679 bool allow_natives_syntax_; 679 bool allow_natives_syntax_;
680 v8::Extension* extension_; 680 v8::Extension* extension_;
681 bool is_pre_parsing_; 681 bool is_pre_parsing_;
682 ScriptDataImpl* pre_data_; 682 ScriptDataImpl* pre_data_;
683 FuncNameInferrer* fni_; 683 FuncNameInferrer* fni_;
684 bool stack_overflow_; 684 bool stack_overflow_;
685 // If true, the next (and immediately following) function literal is
686 // preceded by a parenthesis.
687 // Heuristically that means that the function will be called immediately,
688 // so never lazily compile it.
689 bool parenthesized_function_;
685 }; 690 };
686 691
687 692
688 // Support for handling complex values (array and object literals) that 693 // Support for handling complex values (array and object literals) that
689 // can be fully handled at compile time. 694 // can be fully handled at compile time.
690 class CompileTimeValue: public AllStatic { 695 class CompileTimeValue: public AllStatic {
691 public: 696 public:
692 enum Type { 697 enum Type {
693 OBJECT_LITERAL_FAST_ELEMENTS, 698 OBJECT_LITERAL_FAST_ELEMENTS,
694 OBJECT_LITERAL_SLOW_ELEMENTS, 699 OBJECT_LITERAL_SLOW_ELEMENTS,
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 Handle<Object> ReportUnexpectedToken() { return Handle<Object>::null(); } 771 Handle<Object> ReportUnexpectedToken() { return Handle<Object>::null(); }
767 // Converts the currently parsed literal to a JavaScript String. 772 // Converts the currently parsed literal to a JavaScript String.
768 Handle<String> GetString(); 773 Handle<String> GetString();
769 774
770 JsonScanner scanner_; 775 JsonScanner scanner_;
771 bool stack_overflow_; 776 bool stack_overflow_;
772 }; 777 };
773 } } // namespace v8::internal 778 } } // namespace v8::internal
774 779
775 #endif // V8_PARSER_H_ 780 #endif // V8_PARSER_H_
OLDNEW
« no previous file with comments | « no previous file | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698