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

Side by Side Diff: src/scanner-character-streams.cc

Issue 216523004: Cleanup scanner character streams. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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-character-streams.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 // GenericStringUtf16CharacterStream 119 // GenericStringUtf16CharacterStream
120 120
121 121
122 GenericStringUtf16CharacterStream::GenericStringUtf16CharacterStream( 122 GenericStringUtf16CharacterStream::GenericStringUtf16CharacterStream(
123 Handle<String> data, 123 Handle<String> data,
124 unsigned start_position, 124 unsigned start_position,
125 unsigned end_position) 125 unsigned end_position)
126 : string_(data), 126 : string_(data),
127 length_(end_position) { 127 length_(end_position) {
128 ASSERT(end_position >= start_position); 128 ASSERT(end_position >= start_position);
129 buffer_cursor_ = buffer_;
130 buffer_end_ = buffer_;
131 pos_ = start_position; 129 pos_ = start_position;
132 } 130 }
133 131
134 132
135 GenericStringUtf16CharacterStream::~GenericStringUtf16CharacterStream() { } 133 GenericStringUtf16CharacterStream::~GenericStringUtf16CharacterStream() { }
136 134
137 135
138 unsigned GenericStringUtf16CharacterStream::BufferSeekForward(unsigned delta) { 136 unsigned GenericStringUtf16CharacterStream::BufferSeekForward(unsigned delta) {
139 unsigned old_pos = pos_; 137 unsigned old_pos = pos_;
140 pos_ = Min(pos_ + delta, length_); 138 pos_ = Min(pos_ + delta, length_);
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 int end_position) 314 int end_position)
317 : Utf16CharacterStream(), 315 : Utf16CharacterStream(),
318 source_(data), 316 source_(data),
319 raw_data_(data->GetTwoByteData(start_position)) { 317 raw_data_(data->GetTwoByteData(start_position)) {
320 buffer_cursor_ = raw_data_, 318 buffer_cursor_ = raw_data_,
321 buffer_end_ = raw_data_ + (end_position - start_position); 319 buffer_end_ = raw_data_ + (end_position - start_position);
322 pos_ = start_position; 320 pos_ = start_position;
323 } 321 }
324 322
325 } } // namespace v8::internal 323 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/scanner-character-streams.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698