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

Side by Side Diff: src/lexer/lexer.h

Issue 202953004: Experimental parser: fix two byte to one byte allocation (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 9 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 | « no previous file | src/lexer/lexer.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 virtual bool ScanRegExpPattern(bool seen_equal); 344 virtual bool ScanRegExpPattern(bool seen_equal);
345 virtual bool ScanRegExpFlags(); 345 virtual bool ScanRegExpFlags();
346 virtual Location octal_position() const; 346 virtual Location octal_position() const;
347 virtual void clear_octal_position() { last_octal_end_ = NULL; } 347 virtual void clear_octal_position() { last_octal_end_ = NULL; }
348 348
349 static inline bool MustBeInBuffer(const TokenDesc& token) { 349 static inline bool MustBeInBuffer(const TokenDesc& token) {
350 return token.has_escapes || 350 return token.has_escapes ||
351 (sizeof(Char) == 1 && !token.is_in_primary_range); 351 (sizeof(Char) == 1 && !token.is_in_primary_range);
352 } 352 }
353 353
354 static inline bool MustBeInBufferForAllocation(const TokenDesc& token) {
355 return MustBeInBuffer(token) ||
356 (sizeof(Char) == 2 && token.is_in_primary_range);
357 }
358
354 protected: 359 protected:
355 virtual void Scan(); 360 virtual void Scan();
356 361
357 private: 362 private:
358 uc32 ScanHexNumber(int length); 363 uc32 ScanHexNumber(int length);
359 364
360 bool ScanLiteralUnicodeEscape(); 365 bool ScanLiteralUnicodeEscape();
361 366
362 const Char* GetNewBufferBasedOnHandle() const; 367 const Char* GetNewBufferBasedOnHandle() const;
363 virtual void UpdateBufferBasedOnHandle(); 368 virtual void UpdateBufferBasedOnHandle();
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 bool harmony_scoping_; 519 bool harmony_scoping_;
515 }; 520 };
516 521
517 522
518 #endif 523 #endif
519 524
520 525
521 } } 526 } }
522 527
523 #endif // V8_LEXER_EXPERIMENTAL_SCANNER_H 528 #endif // V8_LEXER_EXPERIMENTAL_SCANNER_H
OLDNEW
« no previous file with comments | « no previous file | src/lexer/lexer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698