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

Side by Side Diff: src/preparser.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 | « src/parser.cc ('k') | src/preparser.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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 // Private constructor only used in PreParseProgram. 137 // Private constructor only used in PreParseProgram.
138 PreParser(i::JavaScriptScanner* scanner, 138 PreParser(i::JavaScriptScanner* scanner,
139 i::ParserRecorder* log, 139 i::ParserRecorder* log,
140 uintptr_t stack_limit, 140 uintptr_t stack_limit,
141 bool allow_lazy) 141 bool allow_lazy)
142 : scanner_(scanner), 142 : scanner_(scanner),
143 log_(log), 143 log_(log),
144 scope_(NULL), 144 scope_(NULL),
145 stack_limit_(stack_limit), 145 stack_limit_(stack_limit),
146 stack_overflow_(false), 146 stack_overflow_(false),
147 allow_lazy_(true) { } 147 allow_lazy_(true),
148 parenthesized_function_(false) { }
148 149
149 // Preparse the program. Only called in PreParseProgram after creating 150 // Preparse the program. Only called in PreParseProgram after creating
150 // the instance. 151 // the instance.
151 PreParseResult PreParse() { 152 PreParseResult PreParse() {
152 Scope top_scope(&scope_, kTopLevelScope); 153 Scope top_scope(&scope_, kTopLevelScope);
153 bool ok = true; 154 bool ok = true;
154 ParseSourceElements(i::Token::EOS, &ok); 155 ParseSourceElements(i::Token::EOS, &ok);
155 if (stack_overflow_) return kPreParseStackOverflow; 156 if (stack_overflow_) return kPreParseStackOverflow;
156 if (!ok) { 157 if (!ok) {
157 ReportUnexpectedToken(scanner_->current_token()); 158 ReportUnexpectedToken(scanner_->current_token());
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 void ExpectSemicolon(bool* ok); 262 void ExpectSemicolon(bool* ok);
262 263
263 static int Precedence(i::Token::Value tok, bool accept_IN); 264 static int Precedence(i::Token::Value tok, bool accept_IN);
264 265
265 i::JavaScriptScanner* scanner_; 266 i::JavaScriptScanner* scanner_;
266 i::ParserRecorder* log_; 267 i::ParserRecorder* log_;
267 Scope* scope_; 268 Scope* scope_;
268 uintptr_t stack_limit_; 269 uintptr_t stack_limit_;
269 bool stack_overflow_; 270 bool stack_overflow_;
270 bool allow_lazy_; 271 bool allow_lazy_;
272 bool parenthesized_function_;
271 }; 273 };
272 } } // v8::preparser 274 } } // v8::preparser
273 275
274 #endif // V8_PREPARSER_H 276 #endif // V8_PREPARSER_H
OLDNEW
« no previous file with comments | « src/parser.cc ('k') | src/preparser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698