| OLD | NEW |
| 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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 | 504 |
| 505 | 505 |
| 506 void LexerBase::LiteralDesc::SetTwoByteString(Vector<const uint16_t> string) { | 506 void LexerBase::LiteralDesc::SetTwoByteString(Vector<const uint16_t> string) { |
| 507 is_in_buffer_ = false; | 507 is_in_buffer_ = false; |
| 508 is_one_byte_ = false; | 508 is_one_byte_ = false; |
| 509 two_byte_string_ = string; | 509 two_byte_string_ = string; |
| 510 } | 510 } |
| 511 | 511 |
| 512 | 512 |
| 513 void LexerBase::LiteralDesc::SetStringFromLiteralBuffer() { | 513 void LexerBase::LiteralDesc::SetStringFromLiteralBuffer() { |
| 514 is_one_byte_ = buffer.is_ascii(); | 514 is_one_byte_ = buffer.is_one_byte(); |
| 515 is_in_buffer_ = true; | 515 is_in_buffer_ = true; |
| 516 length = buffer.length(); | 516 length = buffer.length(); |
| 517 if (is_one_byte_) { | 517 if (is_one_byte_) { |
| 518 if (is_one_byte_string_owned_) { | 518 if (is_one_byte_string_owned_) { |
| 519 one_byte_string_.Dispose(); | 519 one_byte_string_.Dispose(); |
| 520 } | 520 } |
| 521 is_one_byte_string_owned_ = false; | 521 is_one_byte_string_owned_ = false; |
| 522 one_byte_string_ = Vector<const uint8_t>::cast(buffer.ascii_literal()); | 522 one_byte_string_ = buffer.one_byte_literal(); |
| 523 } else { | 523 } else { |
| 524 two_byte_string_ = buffer.utf16_literal(); | 524 two_byte_string_ = buffer.two_byte_literal(); |
| 525 } | 525 } |
| 526 } | 526 } |
| 527 | 527 |
| 528 | 528 |
| 529 static inline bool IsOneByte(const uint8_t* cursor, const uint8_t* end) { | 529 static inline bool IsOneByte(const uint8_t* cursor, const uint8_t* end) { |
| 530 return true; | 530 return true; |
| 531 } | 531 } |
| 532 | 532 |
| 533 | 533 |
| 534 static inline bool IsOneByte(const uint16_t* cursor, const uint16_t* end) { | 534 static inline bool IsOneByte(const uint16_t* cursor, const uint16_t* end) { |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 CHECK(false); | 729 CHECK(false); |
| 730 return Handle<String>(); | 730 return Handle<String>(); |
| 731 } | 731 } |
| 732 | 732 |
| 733 | 733 |
| 734 template class Lexer<uint8_t>; | 734 template class Lexer<uint8_t>; |
| 735 template class Lexer<uint16_t>; | 735 template class Lexer<uint16_t>; |
| 736 template class Lexer<int8_t>; | 736 template class Lexer<int8_t>; |
| 737 | 737 |
| 738 } } // v8::internal | 738 } } // v8::internal |
| OLD | NEW |