OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 break; | 214 break; |
215 case THE_HOLE: | 215 case THE_HOLE: |
216 set_value(isolate->factory()->the_hole_value()); | 216 set_value(isolate->factory()->the_hole_value()); |
217 break; | 217 break; |
218 case UNDEFINED: | 218 case UNDEFINED: |
219 set_value(isolate->factory()->undefined_value()); | 219 set_value(isolate->factory()->undefined_value()); |
220 break; | 220 break; |
221 } | 221 } |
222 } | 222 } |
223 | 223 |
| 224 |
224 AstRawString* AstValueFactory::GetOneByteStringInternal( | 225 AstRawString* AstValueFactory::GetOneByteStringInternal( |
225 Vector<const uint8_t> literal) { | 226 Vector<const uint8_t> literal) { |
226 if (literal.length() == 1 && IsInRange(literal[0], 'a', 'z')) { | 227 if (literal.length() == 1 && IsInRange(literal[0], 'a', 'z')) { |
227 int key = literal[0] - 'a'; | 228 int key = literal[0] - 'a'; |
228 if (one_character_strings_[key] == nullptr) { | 229 if (one_character_strings_[key] == nullptr) { |
229 uint32_t hash = StringHasher::HashSequentialString<uint8_t>( | 230 uint32_t hash = StringHasher::HashSequentialString<uint8_t>( |
230 literal.start(), literal.length(), hash_seed_); | 231 literal.start(), literal.length(), hash_seed_); |
231 one_character_strings_[key] = GetString(hash, true, literal); | 232 one_character_strings_[key] = GetString(hash, true, literal); |
232 } | 233 } |
233 return one_character_strings_[key]; | 234 return one_character_strings_[key]; |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 length) == 0; | 398 length) == 0; |
398 } else { | 399 } else { |
399 return CompareCharsUnsigned(reinterpret_cast<const uint16_t*>(l), | 400 return CompareCharsUnsigned(reinterpret_cast<const uint16_t*>(l), |
400 reinterpret_cast<const uint16_t*>(r), | 401 reinterpret_cast<const uint16_t*>(r), |
401 length) == 0; | 402 length) == 0; |
402 } | 403 } |
403 } | 404 } |
404 } | 405 } |
405 } // namespace internal | 406 } // namespace internal |
406 } // namespace v8 | 407 } // namespace v8 |
OLD | NEW |