OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 uintptr_t stack_limit) { | 143 uintptr_t stack_limit) { |
144 bool allow_lazy = (flags & i::kAllowLazy) != 0; | 144 bool allow_lazy = (flags & i::kAllowLazy) != 0; |
145 bool allow_natives_syntax = (flags & i::kAllowNativesSyntax) != 0; | 145 bool allow_natives_syntax = (flags & i::kAllowNativesSyntax) != 0; |
146 bool allow_modules = (flags & i::kAllowModules) != 0; | 146 bool allow_modules = (flags & i::kAllowModules) != 0; |
147 return PreParser(scanner, log, stack_limit, allow_lazy, | 147 return PreParser(scanner, log, stack_limit, allow_lazy, |
148 allow_natives_syntax, allow_modules).PreParse(); | 148 allow_natives_syntax, allow_modules).PreParse(); |
149 } | 149 } |
150 | 150 |
151 // Parses a single function literal, from the opening parentheses before | 151 // Parses a single function literal, from the opening parentheses before |
152 // parameters to the closing brace after the body. | 152 // parameters to the closing brace after the body. |
153 // Returns a FunctionEntry describing the body of the funciton in enough | 153 // Returns a FunctionEntry describing the body of the function in enough |
154 // detail that it can be lazily compiled. | 154 // detail that it can be lazily compiled. |
155 // The scanner is expected to have matched the "function" keyword and | 155 // The scanner is expected to have matched the "function" keyword and |
156 // parameters, and have consumed the initial '{'. | 156 // parameters, and have consumed the initial '{'. |
157 // At return, unless an error occured, the scanner is positioned before the | 157 // At return, unless an error occurred, the scanner is positioned before the |
158 // the final '}'. | 158 // the final '}'. |
159 PreParseResult PreParseLazyFunction(i::LanguageMode mode, | 159 PreParseResult PreParseLazyFunction(i::LanguageMode mode, |
160 i::ParserRecorder* log); | 160 i::ParserRecorder* log); |
161 | 161 |
162 private: | 162 private: |
163 // Used to detect duplicates in object literals. Each of the values | 163 // Used to detect duplicates in object literals. Each of the values |
164 // kGetterProperty, kSetterProperty and kValueProperty represents | 164 // kGetterProperty, kSetterProperty and kValueProperty represents |
165 // a type of object literal property. When parsing a property, its | 165 // a type of object literal property. When parsing a property, its |
166 // type value is stored in the DuplicateFinder for the property name. | 166 // type value is stored in the DuplicateFinder for the property name. |
167 // Values are chosen so that having intersection bits means the there is | 167 // Values are chosen so that having intersection bits means the there is |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 bool stack_overflow_; | 663 bool stack_overflow_; |
664 bool allow_lazy_; | 664 bool allow_lazy_; |
665 bool allow_modules_; | 665 bool allow_modules_; |
666 bool allow_natives_syntax_; | 666 bool allow_natives_syntax_; |
667 bool parenthesized_function_; | 667 bool parenthesized_function_; |
668 bool harmony_scoping_; | 668 bool harmony_scoping_; |
669 }; | 669 }; |
670 } } // v8::preparser | 670 } } // v8::preparser |
671 | 671 |
672 #endif // V8_PREPARSER_H | 672 #endif // V8_PREPARSER_H |
OLD | NEW |