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 6667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6678 return key; | 6678 return key; |
6679 } | 6679 } |
6680 | 6680 |
6681 | 6681 |
6682 void NameDictionary::DoGenerateNewEnumerationIndices( | 6682 void NameDictionary::DoGenerateNewEnumerationIndices( |
6683 Handle<NameDictionary> dictionary) { | 6683 Handle<NameDictionary> dictionary) { |
6684 DerivedDictionary::GenerateNewEnumerationIndices(dictionary); | 6684 DerivedDictionary::GenerateNewEnumerationIndices(dictionary); |
6685 } | 6685 } |
6686 | 6686 |
6687 | 6687 |
6688 bool ObjectHashTableShape::IsMatch(Object* key, Object* other) { | 6688 bool ObjectHashTableShape::IsMatch(Handle<Object> key, Object* other) { |
6689 return key->SameValue(other); | 6689 return key->SameValue(other); |
6690 } | 6690 } |
6691 | 6691 |
6692 | 6692 |
6693 uint32_t ObjectHashTableShape::Hash(Object* key) { | 6693 uint32_t ObjectHashTableShape::Hash(Handle<Object> key) { |
6694 return Smi::cast(key->GetHash())->value(); | 6694 return Smi::cast(key->GetHash())->value(); |
6695 } | 6695 } |
6696 | 6696 |
6697 | 6697 |
6698 uint32_t ObjectHashTableShape::HashForObject(Object* key, Object* other) { | 6698 uint32_t ObjectHashTableShape::HashForObject(Handle<Object> key, |
| 6699 Object* other) { |
6699 return Smi::cast(other->GetHash())->value(); | 6700 return Smi::cast(other->GetHash())->value(); |
6700 } | 6701 } |
6701 | 6702 |
6702 | 6703 |
6703 MaybeObject* ObjectHashTableShape::AsObject(Heap* heap, Object* key) { | 6704 MaybeObject* ObjectHashTableShape::AsObject(Heap* heap, Handle<Object> key) { |
| 6705 return *key; |
| 6706 } |
| 6707 |
| 6708 |
| 6709 Handle<Object> ObjectHashTableShape::AsHandle(Isolate* isolate, |
| 6710 Handle<Object> key) { |
6704 return key; | 6711 return key; |
6705 } | 6712 } |
6706 | 6713 |
6707 | 6714 |
6708 Handle<ObjectHashTable> ObjectHashTable::Shrink( | 6715 Handle<ObjectHashTable> ObjectHashTable::Shrink( |
6709 Handle<ObjectHashTable> table, Handle<Object> key) { | 6716 Handle<ObjectHashTable> table, Handle<Object> key) { |
6710 return DerivedHashTable::Shrink(table, *key); | 6717 return DerivedHashTable::Shrink(table, key); |
6711 } | 6718 } |
6712 | 6719 |
6713 | 6720 |
6714 template <int entrysize> | 6721 template <int entrysize> |
6715 bool WeakHashTableShape<entrysize>::IsMatch(Object* key, Object* other) { | 6722 bool WeakHashTableShape<entrysize>::IsMatch(Handle<Object> key, Object* other) { |
6716 return key->SameValue(other); | 6723 return key->SameValue(other); |
6717 } | 6724 } |
6718 | 6725 |
6719 | 6726 |
6720 template <int entrysize> | 6727 template <int entrysize> |
6721 uint32_t WeakHashTableShape<entrysize>::Hash(Object* key) { | 6728 uint32_t WeakHashTableShape<entrysize>::Hash(Handle<Object> key) { |
6722 intptr_t hash = reinterpret_cast<intptr_t>(key); | 6729 intptr_t hash = reinterpret_cast<intptr_t>(*key); |
6723 return (uint32_t)(hash & 0xFFFFFFFF); | 6730 return (uint32_t)(hash & 0xFFFFFFFF); |
6724 } | 6731 } |
6725 | 6732 |
6726 | 6733 |
6727 template <int entrysize> | 6734 template <int entrysize> |
6728 uint32_t WeakHashTableShape<entrysize>::HashForObject(Object* key, | 6735 uint32_t WeakHashTableShape<entrysize>::HashForObject(Handle<Object> key, |
6729 Object* other) { | 6736 Object* other) { |
6730 intptr_t hash = reinterpret_cast<intptr_t>(other); | 6737 intptr_t hash = reinterpret_cast<intptr_t>(other); |
6731 return (uint32_t)(hash & 0xFFFFFFFF); | 6738 return (uint32_t)(hash & 0xFFFFFFFF); |
6732 } | 6739 } |
6733 | 6740 |
6734 | 6741 |
6735 template <int entrysize> | 6742 template <int entrysize> |
6736 MaybeObject* WeakHashTableShape<entrysize>::AsObject(Heap* heap, | 6743 Handle<Object> WeakHashTableShape<entrysize>::AsHandle(Isolate* isolate, |
6737 Object* key) { | 6744 Handle<Object> key) { |
6738 return key; | 6745 return key; |
6739 } | 6746 } |
6740 | 6747 |
6741 | 6748 |
6742 void Map::ClearCodeCache(Heap* heap) { | 6749 void Map::ClearCodeCache(Heap* heap) { |
6743 // No write barrier is needed since empty_fixed_array is not in new space. | 6750 // No write barrier is needed since empty_fixed_array is not in new space. |
6744 // Please note this function is used during marking: | 6751 // Please note this function is used during marking: |
6745 // - MarkCompactCollector::MarkUnmarkedObject | 6752 // - MarkCompactCollector::MarkUnmarkedObject |
6746 // - IncrementalMarking::Step | 6753 // - IncrementalMarking::Step |
6747 ASSERT(!heap->InNewSpace(heap->empty_fixed_array())); | 6754 ASSERT(!heap->InNewSpace(heap->empty_fixed_array())); |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7027 #undef READ_SHORT_FIELD | 7034 #undef READ_SHORT_FIELD |
7028 #undef WRITE_SHORT_FIELD | 7035 #undef WRITE_SHORT_FIELD |
7029 #undef READ_BYTE_FIELD | 7036 #undef READ_BYTE_FIELD |
7030 #undef WRITE_BYTE_FIELD | 7037 #undef WRITE_BYTE_FIELD |
7031 #undef NOBARRIER_READ_BYTE_FIELD | 7038 #undef NOBARRIER_READ_BYTE_FIELD |
7032 #undef NOBARRIER_WRITE_BYTE_FIELD | 7039 #undef NOBARRIER_WRITE_BYTE_FIELD |
7033 | 7040 |
7034 } } // namespace v8::internal | 7041 } } // namespace v8::internal |
7035 | 7042 |
7036 #endif // V8_OBJECTS_INL_H_ | 7043 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |