| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/scanner-character-streams.h" | 7 #include "src/scanner-character-streams.h" |
| 8 | 8 |
| 9 #include "include/v8.h" | 9 #include "include/v8.h" |
| 10 #include "src/handles.h" | 10 #include "src/handles.h" |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 raw_data_length_); | 227 raw_data_length_); |
| 228 raw_character_position_ = char_position + i; | 228 raw_character_position_ = char_position + i; |
| 229 return i; | 229 return i; |
| 230 } | 230 } |
| 231 | 231 |
| 232 | 232 |
| 233 static const byte kUtf8MultiByteMask = 0xC0; | 233 static const byte kUtf8MultiByteMask = 0xC0; |
| 234 static const byte kUtf8MultiByteCharFollower = 0x80; | 234 static const byte kUtf8MultiByteCharFollower = 0x80; |
| 235 | 235 |
| 236 | 236 |
| 237 #ifdef DEBUG | 237 #if DCHECK_IS_ON |
| 238 static const byte kUtf8MultiByteCharStart = 0xC0; | 238 static const byte kUtf8MultiByteCharStart = 0xC0; |
| 239 static bool IsUtf8MultiCharacterStart(byte first_byte) { | 239 static bool IsUtf8MultiCharacterStart(byte first_byte) { |
| 240 return (first_byte & kUtf8MultiByteMask) == kUtf8MultiByteCharStart; | 240 return (first_byte & kUtf8MultiByteMask) == kUtf8MultiByteCharStart; |
| 241 } | 241 } |
| 242 #endif | 242 #endif |
| 243 | 243 |
| 244 | 244 |
| 245 static bool IsUtf8MultiCharacterFollower(byte later_byte) { | 245 static bool IsUtf8MultiCharacterFollower(byte later_byte) { |
| 246 return (later_byte & kUtf8MultiByteMask) == kUtf8MultiByteCharFollower; | 246 return (later_byte & kUtf8MultiByteMask) == kUtf8MultiByteCharFollower; |
| 247 } | 247 } |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 int end_position) | 459 int end_position) |
| 460 : Utf16CharacterStream(), | 460 : Utf16CharacterStream(), |
| 461 source_(data), | 461 source_(data), |
| 462 raw_data_(data->GetTwoByteData(start_position)) { | 462 raw_data_(data->GetTwoByteData(start_position)) { |
| 463 buffer_cursor_ = raw_data_, | 463 buffer_cursor_ = raw_data_, |
| 464 buffer_end_ = raw_data_ + (end_position - start_position); | 464 buffer_end_ = raw_data_ + (end_position - start_position); |
| 465 pos_ = start_position; | 465 pos_ = start_position; |
| 466 } | 466 } |
| 467 | 467 |
| 468 } } // namespace v8::internal | 468 } } // namespace v8::internal |
| OLD | NEW |