| OLD | NEW |
| 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 typename Traits::Type::Zone* zone() const { return zone_; } | 239 typename Traits::Type::Zone* zone() const { return zone_; } |
| 240 | 240 |
| 241 INLINE(Token::Value peek()) { | 241 INLINE(Token::Value peek()) { |
| 242 if (stack_overflow_) return Token::ILLEGAL; | 242 if (stack_overflow_) return Token::ILLEGAL; |
| 243 return scanner()->peek(); | 243 return scanner()->peek(); |
| 244 } | 244 } |
| 245 | 245 |
| 246 INLINE(Token::Value Next()) { | 246 INLINE(Token::Value Next()) { |
| 247 if (stack_overflow_) return Token::ILLEGAL; | 247 if (stack_overflow_) return Token::ILLEGAL; |
| 248 { | 248 { |
| 249 int marker; | 249 if (GetCurrentStackPosition() < stack_limit_) { |
| 250 if (reinterpret_cast<uintptr_t>(&marker) < stack_limit_) { | |
| 251 // Any further calls to Next or peek will return the illegal token. | 250 // Any further calls to Next or peek will return the illegal token. |
| 252 // The current call must return the next token, which might already | 251 // The current call must return the next token, which might already |
| 253 // have been peek'ed. | 252 // have been peek'ed. |
| 254 stack_overflow_ = true; | 253 stack_overflow_ = true; |
| 255 } | 254 } |
| 256 } | 255 } |
| 257 return scanner()->Next(); | 256 return scanner()->Next(); |
| 258 } | 257 } |
| 259 | 258 |
| 260 void Consume(Token::Value token) { | 259 void Consume(Token::Value token) { |
| (...skipping 1966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2227 parser()->ReportMessage("accessor_get_set"); | 2226 parser()->ReportMessage("accessor_get_set"); |
| 2228 } | 2227 } |
| 2229 *ok = false; | 2228 *ok = false; |
| 2230 } | 2229 } |
| 2231 } | 2230 } |
| 2232 | 2231 |
| 2233 | 2232 |
| 2234 } } // v8::internal | 2233 } } // v8::internal |
| 2235 | 2234 |
| 2236 #endif // V8_PREPARSER_H | 2235 #endif // V8_PREPARSER_H |
| OLD | NEW |