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 5937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5948 } | 5948 } |
5949 | 5949 |
5950 | 5950 |
5951 template <int entrysize> | 5951 template <int entrysize> |
5952 MaybeObject* ObjectHashTableShape<entrysize>::AsObject(Heap* heap, | 5952 MaybeObject* ObjectHashTableShape<entrysize>::AsObject(Heap* heap, |
5953 Object* key) { | 5953 Object* key) { |
5954 return key; | 5954 return key; |
5955 } | 5955 } |
5956 | 5956 |
5957 | 5957 |
| 5958 template <int entrysize> |
| 5959 bool WeakHashTableShape<entrysize>::IsMatch(Object* key, Object* other) { |
| 5960 return key->SameValue(other); |
| 5961 } |
| 5962 |
| 5963 |
| 5964 template <int entrysize> |
| 5965 uint32_t WeakHashTableShape<entrysize>::Hash(Object* key) { |
| 5966 intptr_t hash = reinterpret_cast<intptr_t>(key); |
| 5967 return (uint32_t)(hash & 0xFFFFFFFF); |
| 5968 } |
| 5969 |
| 5970 |
| 5971 template <int entrysize> |
| 5972 uint32_t WeakHashTableShape<entrysize>::HashForObject(Object* key, |
| 5973 Object* other) { |
| 5974 intptr_t hash = reinterpret_cast<intptr_t>(other); |
| 5975 return (uint32_t)(hash & 0xFFFFFFFF); |
| 5976 } |
| 5977 |
| 5978 |
| 5979 template <int entrysize> |
| 5980 MaybeObject* WeakHashTableShape<entrysize>::AsObject(Heap* heap, |
| 5981 Object* key) { |
| 5982 return key; |
| 5983 } |
| 5984 |
| 5985 |
5958 void Map::ClearCodeCache(Heap* heap) { | 5986 void Map::ClearCodeCache(Heap* heap) { |
5959 // No write barrier is needed since empty_fixed_array is not in new space. | 5987 // No write barrier is needed since empty_fixed_array is not in new space. |
5960 // Please note this function is used during marking: | 5988 // Please note this function is used during marking: |
5961 // - MarkCompactCollector::MarkUnmarkedObject | 5989 // - MarkCompactCollector::MarkUnmarkedObject |
5962 // - IncrementalMarking::Step | 5990 // - IncrementalMarking::Step |
5963 ASSERT(!heap->InNewSpace(heap->empty_fixed_array())); | 5991 ASSERT(!heap->InNewSpace(heap->empty_fixed_array())); |
5964 WRITE_FIELD(this, kCodeCacheOffset, heap->empty_fixed_array()); | 5992 WRITE_FIELD(this, kCodeCacheOffset, heap->empty_fixed_array()); |
5965 } | 5993 } |
5966 | 5994 |
5967 | 5995 |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6252 #undef WRITE_UINT32_FIELD | 6280 #undef WRITE_UINT32_FIELD |
6253 #undef READ_SHORT_FIELD | 6281 #undef READ_SHORT_FIELD |
6254 #undef WRITE_SHORT_FIELD | 6282 #undef WRITE_SHORT_FIELD |
6255 #undef READ_BYTE_FIELD | 6283 #undef READ_BYTE_FIELD |
6256 #undef WRITE_BYTE_FIELD | 6284 #undef WRITE_BYTE_FIELD |
6257 | 6285 |
6258 | 6286 |
6259 } } // namespace v8::internal | 6287 } } // namespace v8::internal |
6260 | 6288 |
6261 #endif // V8_OBJECTS_INL_H_ | 6289 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |