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

Side by Side Diff: src/preparser.h

Issue 6529032: Merge 6168:6800 from bleeding_edge to experimental/gc branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 years, 10 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/preparse-data.h ('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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 if (reinterpret_cast<uintptr_t>(&marker) < stack_limit_) { 236 if (reinterpret_cast<uintptr_t>(&marker) < stack_limit_) {
236 // Further calls to peek/Next will return illegal token. 237 // Further calls to peek/Next will return illegal token.
237 // The current one will still be returned. It might already 238 // The current one will still be returned. It might already
238 // have been seen using peek. 239 // have been seen using peek.
239 stack_overflow_ = true; 240 stack_overflow_ = true;
240 } 241 }
241 } 242 }
242 return scanner_->Next(); 243 return scanner_->Next();
243 } 244 }
244 245
246 bool peek_any_identifier();
247
245 void Consume(i::Token::Value token) { Next(); } 248 void Consume(i::Token::Value token) { Next(); }
246 249
247 void Expect(i::Token::Value token, bool* ok) { 250 void Expect(i::Token::Value token, bool* ok) {
248 if (Next() != token) { 251 if (Next() != token) {
249 *ok = false; 252 *ok = false;
250 } 253 }
251 } 254 }
252 255
253 bool Check(i::Token::Value token) { 256 bool Check(i::Token::Value token) {
254 i::Token::Value next = peek(); 257 i::Token::Value next = peek();
255 if (next == token) { 258 if (next == token) {
256 Consume(next); 259 Consume(next);
257 return true; 260 return true;
258 } 261 }
259 return false; 262 return false;
260 } 263 }
261 void ExpectSemicolon(bool* ok); 264 void ExpectSemicolon(bool* ok);
262 265
263 static int Precedence(i::Token::Value tok, bool accept_IN); 266 static int Precedence(i::Token::Value tok, bool accept_IN);
264 267
265 i::JavaScriptScanner* scanner_; 268 i::JavaScriptScanner* scanner_;
266 i::ParserRecorder* log_; 269 i::ParserRecorder* log_;
267 Scope* scope_; 270 Scope* scope_;
268 uintptr_t stack_limit_; 271 uintptr_t stack_limit_;
269 bool stack_overflow_; 272 bool stack_overflow_;
270 bool allow_lazy_; 273 bool allow_lazy_;
274 bool parenthesized_function_;
271 }; 275 };
272 } } // v8::preparser 276 } } // v8::preparser
273 277
274 #endif // V8_PREPARSER_H 278 #endif // V8_PREPARSER_H
OLDNEW
« no previous file with comments | « src/preparse-data.h ('k') | src/preparser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698