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 14509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14520 MaybeHandle<Map> maybe_map = | 14520 MaybeHandle<Map> maybe_map = |
14521 isolate->factory()->InternalizedStringMapForString(string_); | 14521 isolate->factory()->InternalizedStringMapForString(string_); |
14522 Handle<Map> map; | 14522 Handle<Map> map; |
14523 if (maybe_map.ToHandle(&map)) { | 14523 if (maybe_map.ToHandle(&map)) { |
14524 string_->set_map_no_write_barrier(*map); | 14524 string_->set_map_no_write_barrier(*map); |
14525 ASSERT(string_->IsInternalizedString()); | 14525 ASSERT(string_->IsInternalizedString()); |
14526 return string_; | 14526 return string_; |
14527 } | 14527 } |
14528 // Otherwise allocate a new internalized string. | 14528 // Otherwise allocate a new internalized string. |
14529 return isolate->factory()->NewInternalizedStringImpl( | 14529 return isolate->factory()->NewInternalizedStringImpl( |
14530 *string_, string_->length(), string_->hash_field()); | 14530 string_, string_->length(), string_->hash_field()); |
14531 } | 14531 } |
14532 | 14532 |
14533 static uint32_t StringHash(Object* obj) { | 14533 static uint32_t StringHash(Object* obj) { |
14534 return String::cast(obj)->Hash(); | 14534 return String::cast(obj)->Hash(); |
14535 } | 14535 } |
14536 | 14536 |
14537 Handle<String> string_; | 14537 Handle<String> string_; |
14538 }; | 14538 }; |
14539 | 14539 |
14540 | 14540 |
(...skipping 2760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17301 #define ERROR_MESSAGES_TEXTS(C, T) T, | 17301 #define ERROR_MESSAGES_TEXTS(C, T) T, |
17302 static const char* error_messages_[] = { | 17302 static const char* error_messages_[] = { |
17303 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 17303 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
17304 }; | 17304 }; |
17305 #undef ERROR_MESSAGES_TEXTS | 17305 #undef ERROR_MESSAGES_TEXTS |
17306 return error_messages_[reason]; | 17306 return error_messages_[reason]; |
17307 } | 17307 } |
17308 | 17308 |
17309 | 17309 |
17310 } } // namespace v8::internal | 17310 } } // namespace v8::internal |
OLD | NEW |