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

Side by Side Diff: src/scanner.cc

Issue 6597029: [Isolates] Merge r 6300:6500 from bleeding_edge to isolates. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: Created 9 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 | « src/scanner.h ('k') | src/scanner-base.h » ('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 30 matching lines...) Expand all
41 BufferedUC16CharacterStream::BufferedUC16CharacterStream() 41 BufferedUC16CharacterStream::BufferedUC16CharacterStream()
42 : UC16CharacterStream(), 42 : UC16CharacterStream(),
43 pushback_limit_(NULL) { 43 pushback_limit_(NULL) {
44 // Initialize buffer as being empty. First read will fill the buffer. 44 // Initialize buffer as being empty. First read will fill the buffer.
45 buffer_cursor_ = buffer_; 45 buffer_cursor_ = buffer_;
46 buffer_end_ = buffer_; 46 buffer_end_ = buffer_;
47 } 47 }
48 48
49 BufferedUC16CharacterStream::~BufferedUC16CharacterStream() { } 49 BufferedUC16CharacterStream::~BufferedUC16CharacterStream() { }
50 50
51 void BufferedUC16CharacterStream::PushBack(uc16 character) { 51 void BufferedUC16CharacterStream::PushBack(uc32 character) {
52 if (pushback_limit_ == NULL && buffer_cursor_ > buffer_) { 52 if (character == kEndOfInput) {
53 // buffer_ is writable, buffer_cursor_ is const pointer.
54 buffer_[--buffer_cursor_ - buffer_] = character;
55 pos_--; 53 pos_--;
56 return; 54 return;
57 } 55 }
58 SlowPushBack(character); 56 if (pushback_limit_ == NULL && buffer_cursor_ > buffer_) {
57 // buffer_ is writable, buffer_cursor_ is const pointer.
58 buffer_[--buffer_cursor_ - buffer_] = static_cast<uc16>(character);
59 pos_--;
60 return;
61 }
62 SlowPushBack(static_cast<uc16>(character));
59 } 63 }
60 64
61 65
62 void BufferedUC16CharacterStream::SlowPushBack(uc16 character) { 66 void BufferedUC16CharacterStream::SlowPushBack(uc16 character) {
63 // In pushback mode, the end of the buffer contains pushback, 67 // In pushback mode, the end of the buffer contains pushback,
64 // and the start of the buffer (from buffer start to pushback_limit_) 68 // and the start of the buffer (from buffer start to pushback_limit_)
65 // contains valid data that comes just after the pushback. 69 // contains valid data that comes just after the pushback.
66 // We NULL the pushback_limit_ if pushing all the way back to the 70 // We NULL the pushback_limit_ if pushing all the way back to the
67 // start of the buffer. 71 // start of the buffer.
68 72
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 Advance(); 554 Advance();
551 text++; 555 text++;
552 } 556 }
553 if (scanner_constants_->IsIdentifierPart(c0_)) return Token::ILLEGAL; 557 if (scanner_constants_->IsIdentifierPart(c0_)) return Token::ILLEGAL;
554 literal.Complete(); 558 literal.Complete();
555 return token; 559 return token;
556 } 560 }
557 561
558 562
559 } } // namespace v8::internal 563 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/scanner.h ('k') | src/scanner-base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698