OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 6625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6636 uint32_t seed, | 6636 uint32_t seed, |
6637 Object* other) { | 6637 Object* other) { |
6638 ASSERT(other->IsNumber()); | 6638 ASSERT(other->IsNumber()); |
6639 return ComputeIntegerHash(static_cast<uint32_t>(other->Number()), seed); | 6639 return ComputeIntegerHash(static_cast<uint32_t>(other->Number()), seed); |
6640 } | 6640 } |
6641 | 6641 |
6642 MaybeObject* NumberDictionaryShape::AsObject(Heap* heap, uint32_t key) { | 6642 MaybeObject* NumberDictionaryShape::AsObject(Heap* heap, uint32_t key) { |
6643 return heap->NumberFromUint32(key); | 6643 return heap->NumberFromUint32(key); |
6644 } | 6644 } |
6645 | 6645 |
| 6646 Handle<Object> NumberDictionaryShape::AsHandle(Isolate* isolate, uint32_t key) { |
| 6647 return isolate->factory()->NewNumberFromUint(key); |
| 6648 } |
| 6649 |
6646 | 6650 |
6647 bool NameDictionaryShape::IsMatch(Name* key, Object* other) { | 6651 bool NameDictionaryShape::IsMatch(Name* key, Object* other) { |
6648 // We know that all entries in a hash table had their hash keys created. | 6652 // We know that all entries in a hash table had their hash keys created. |
6649 // Use that knowledge to have fast failure. | 6653 // Use that knowledge to have fast failure. |
6650 if (key->Hash() != Name::cast(other)->Hash()) return false; | 6654 if (key->Hash() != Name::cast(other)->Hash()) return false; |
6651 return key->Equals(Name::cast(other)); | 6655 return key->Equals(Name::cast(other)); |
6652 } | 6656 } |
6653 | 6657 |
6654 | 6658 |
6655 uint32_t NameDictionaryShape::Hash(Name* key) { | 6659 uint32_t NameDictionaryShape::Hash(Name* key) { |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7010 #undef READ_SHORT_FIELD | 7014 #undef READ_SHORT_FIELD |
7011 #undef WRITE_SHORT_FIELD | 7015 #undef WRITE_SHORT_FIELD |
7012 #undef READ_BYTE_FIELD | 7016 #undef READ_BYTE_FIELD |
7013 #undef WRITE_BYTE_FIELD | 7017 #undef WRITE_BYTE_FIELD |
7014 #undef NOBARRIER_READ_BYTE_FIELD | 7018 #undef NOBARRIER_READ_BYTE_FIELD |
7015 #undef NOBARRIER_WRITE_BYTE_FIELD | 7019 #undef NOBARRIER_WRITE_BYTE_FIELD |
7016 | 7020 |
7017 } } // namespace v8::internal | 7021 } } // namespace v8::internal |
7018 | 7022 |
7019 #endif // V8_OBJECTS_INL_H_ | 7023 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |