| OLD | NEW |
| 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 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 } | 678 } |
| 679 } else { | 679 } else { |
| 680 return SlowScanJsonString<SeqOneByteString, char>(source_, | 680 return SlowScanJsonString<SeqOneByteString, char>(source_, |
| 681 beg_pos, | 681 beg_pos, |
| 682 position_); | 682 position_); |
| 683 } | 683 } |
| 684 } while (c0_ != '"'); | 684 } while (c0_ != '"'); |
| 685 int length = position_ - beg_pos; | 685 int length = position_ - beg_pos; |
| 686 Handle<String> result; | 686 Handle<String> result; |
| 687 if (seq_ascii && is_symbol) { | 687 if (seq_ascii && is_symbol) { |
| 688 result = factory()->LookupAsciiSymbol(seq_source_, | 688 result = factory()->LookupOneByteSymbol(seq_source_, beg_pos, length); |
| 689 beg_pos, | |
| 690 length); | |
| 691 } else { | 689 } else { |
| 692 result = factory()->NewRawOneByteString(length, pretenure_); | 690 result = factory()->NewRawOneByteString(length, pretenure_); |
| 693 char* dest = SeqOneByteString::cast(*result)->GetChars(); | 691 char* dest = SeqOneByteString::cast(*result)->GetChars(); |
| 694 String::WriteToFlat(*source_, dest, beg_pos, position_); | 692 String::WriteToFlat(*source_, dest, beg_pos, position_); |
| 695 } | 693 } |
| 696 ASSERT_EQ('"', c0_); | 694 ASSERT_EQ('"', c0_); |
| 697 // Advance past the last '"'. | 695 // Advance past the last '"'. |
| 698 AdvanceSkipWhitespace(); | 696 AdvanceSkipWhitespace(); |
| 699 return result; | 697 return result; |
| 700 } | 698 } |
| 701 | 699 |
| 702 } } // namespace v8::internal | 700 } } // namespace v8::internal |
| 703 | 701 |
| 704 #endif // V8_JSON_PARSER_H_ | 702 #endif // V8_JSON_PARSER_H_ |
| OLD | NEW |