From dc1fe284b7ed59b5046bab2bbd17cf1d6261dc06 Mon Sep 17 00:00:00 2001 From: "ishell@chromium.org" Date: Fri, 25 Apr 2014 13:50:19 +0000 Subject: [PATCH] *Shape::AsObject() are no longer used - removed. R=yangguo@chromium.org Review URL: https://codereview.chromium.org/256773002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20986 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/objects-inl.h | 37 +++++++++++++++++++++++-------------- src/objects.h | 31 ++++++++----------------------- 2 files changed, 31 insertions(+), 37 deletions(-) diff --git a/src/objects-inl.h b/src/objects-inl.h index 54dbd5e..f208705 100644 --- a/src/objects-inl.h +++ b/src/objects-inl.h @@ -475,6 +475,27 @@ Handle HashTableKey::AsHandle(Isolate* isolate) { } +Handle StringTableShape::AsHandle(Isolate* isolate, HashTableKey* key) { + return key->AsHandle(isolate); +} + + +Handle MapCacheShape::AsHandle(Isolate* isolate, HashTableKey* key) { + return key->AsHandle(isolate); +} + + +Handle CompilationCacheShape::AsHandle(Isolate* isolate, + HashTableKey* key) { + return key->AsHandle(isolate); +} + + +Handle CodeCacheHashTableShape::AsHandle(Isolate* isolate, + HashTableKey* key) { + return key->AsHandle(isolate); +} + template class SequentialStringKey : public HashTableKey { public: @@ -6626,10 +6647,12 @@ uint32_t UnseededNumberDictionaryShape::HashForObject(uint32_t key, return ComputeIntegerHash(static_cast(other->Number()), 0); } + uint32_t SeededNumberDictionaryShape::SeededHash(uint32_t key, uint32_t seed) { return ComputeIntegerHash(key, seed); } + uint32_t SeededNumberDictionaryShape::SeededHashForObject(uint32_t key, uint32_t seed, Object* other) { @@ -6637,9 +6660,6 @@ uint32_t SeededNumberDictionaryShape::SeededHashForObject(uint32_t key, return ComputeIntegerHash(static_cast(other->Number()), seed); } -MaybeObject* NumberDictionaryShape::AsObject(Heap* heap, uint32_t key) { - return heap->NumberFromUint32(key); -} Handle NumberDictionaryShape::AsHandle(Isolate* isolate, uint32_t key) { return isolate->factory()->NewNumberFromUint(key); @@ -6664,12 +6684,6 @@ uint32_t NameDictionaryShape::HashForObject(Handle key, Object* other) { } -MaybeObject* NameDictionaryShape::AsObject(Heap* heap, Handle key) { - ASSERT(key->IsUniqueName()); - return *key; -} - - Handle NameDictionaryShape::AsHandle(Isolate* isolate, Handle key) { ASSERT(key->IsUniqueName()); @@ -6699,11 +6713,6 @@ uint32_t ObjectHashTableShape::HashForObject(Handle key, } -MaybeObject* ObjectHashTableShape::AsObject(Heap* heap, Handle key) { - return *key; -} - - Handle ObjectHashTableShape::AsHandle(Isolate* isolate, Handle key) { return key; diff --git a/src/objects.h b/src/objects.h index 8bcf8b9..f14f3f1 100644 --- a/src/objects.h +++ b/src/objects.h @@ -3866,16 +3866,16 @@ class StringTableShape : public BaseShape { static inline bool IsMatch(HashTableKey* key, Object* value) { return key->IsMatch(value); } + static inline uint32_t Hash(HashTableKey* key) { return key->Hash(); } + static inline uint32_t HashForObject(HashTableKey* key, Object* object) { return key->HashForObject(object); } - MUST_USE_RESULT static inline MaybeObject* AsObject(Heap* heap, - HashTableKey* key) { - return key->AsObject(heap); - } + + static inline Handle AsHandle(Isolate* isolate, HashTableKey* key); static const int kPrefixSize = 0; static const int kEntrySize = 1; @@ -3919,6 +3919,7 @@ class MapCacheShape : public BaseShape { static inline bool IsMatch(HashTableKey* key, Object* value) { return key->IsMatch(value); } + static inline uint32_t Hash(HashTableKey* key) { return key->Hash(); } @@ -3927,10 +3928,7 @@ class MapCacheShape : public BaseShape { return key->HashForObject(object); } - MUST_USE_RESULT static inline MaybeObject* AsObject(Heap* heap, - HashTableKey* key) { - return key->AsObject(heap); - } + static inline Handle AsHandle(Isolate* isolate, HashTableKey* key); static const int kPrefixSize = 0; static const int kEntrySize = 2; @@ -4087,8 +4085,6 @@ class NameDictionaryShape : public BaseShape > { static inline bool IsMatch(Handle key, Object* other); static inline uint32_t Hash(Handle key); static inline uint32_t HashForObject(Handle key, Object* object); - MUST_USE_RESULT static inline MaybeObject* AsObject(Heap* heap, - Handle key); static inline Handle AsHandle(Isolate* isolate, Handle key); static const int kPrefixSize = 2; static const int kEntrySize = 3; @@ -4125,9 +4121,6 @@ class NameDictionary: public Dictionary { public: static inline bool IsMatch(uint32_t key, Object* other); - // TODO(ishell): This should be eventually replaced with AsHandle(). - MUST_USE_RESULT static inline MaybeObject* AsObject(Heap* heap, - uint32_t key); static inline Handle AsHandle(Isolate* isolate, uint32_t key); static const int kEntrySize = 3; static const bool kIsEnumerable = false; @@ -4240,8 +4233,6 @@ class ObjectHashTableShape : public BaseShape > { static inline bool IsMatch(Handle key, Object* other); static inline uint32_t Hash(Handle key); static inline uint32_t HashForObject(Handle key, Object* object); - MUST_USE_RESULT static inline MaybeObject* AsObject(Heap* heap, - Handle key); static inline Handle AsHandle(Isolate* isolate, Handle key); static const int kPrefixSize = 0; static const int kEntrySize = 2; @@ -8280,10 +8271,7 @@ class CompilationCacheShape : public BaseShape { return key->HashForObject(object); } - MUST_USE_RESULT static MaybeObject* AsObject(Heap* heap, - HashTableKey* key) { - return key->AsObject(heap); - } + static inline Handle AsHandle(Isolate* isolate, HashTableKey* key); static const int kPrefixSize = 0; static const int kEntrySize = 2; @@ -8383,10 +8371,7 @@ class CodeCacheHashTableShape : public BaseShape { return key->HashForObject(object); } - MUST_USE_RESULT static MaybeObject* AsObject(Heap* heap, - HashTableKey* key) { - return key->AsObject(heap); - } + static inline Handle AsHandle(Isolate* isolate, HashTableKey* key); static const int kPrefixSize = 0; static const int kEntrySize = 2; -- 2.7.4