Commit dc1fe284 authored by ishell@chromium.org's avatar ishell@chromium.org

*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
parent c27da0c9
...@@ -475,6 +475,27 @@ Handle<Object> HashTableKey::AsHandle(Isolate* isolate) { ...@@ -475,6 +475,27 @@ Handle<Object> HashTableKey::AsHandle(Isolate* isolate) {
} }
Handle<Object> StringTableShape::AsHandle(Isolate* isolate, HashTableKey* key) {
return key->AsHandle(isolate);
}
Handle<Object> MapCacheShape::AsHandle(Isolate* isolate, HashTableKey* key) {
return key->AsHandle(isolate);
}
Handle<Object> CompilationCacheShape::AsHandle(Isolate* isolate,
HashTableKey* key) {
return key->AsHandle(isolate);
}
Handle<Object> CodeCacheHashTableShape::AsHandle(Isolate* isolate,
HashTableKey* key) {
return key->AsHandle(isolate);
}
template <typename Char> template <typename Char>
class SequentialStringKey : public HashTableKey { class SequentialStringKey : public HashTableKey {
public: public:
...@@ -6626,10 +6647,12 @@ uint32_t UnseededNumberDictionaryShape::HashForObject(uint32_t key, ...@@ -6626,10 +6647,12 @@ uint32_t UnseededNumberDictionaryShape::HashForObject(uint32_t key,
return ComputeIntegerHash(static_cast<uint32_t>(other->Number()), 0); return ComputeIntegerHash(static_cast<uint32_t>(other->Number()), 0);
} }
uint32_t SeededNumberDictionaryShape::SeededHash(uint32_t key, uint32_t seed) { uint32_t SeededNumberDictionaryShape::SeededHash(uint32_t key, uint32_t seed) {
return ComputeIntegerHash(key, seed); return ComputeIntegerHash(key, seed);
} }
uint32_t SeededNumberDictionaryShape::SeededHashForObject(uint32_t key, uint32_t SeededNumberDictionaryShape::SeededHashForObject(uint32_t key,
uint32_t seed, uint32_t seed,
Object* other) { Object* other) {
...@@ -6637,9 +6660,6 @@ uint32_t SeededNumberDictionaryShape::SeededHashForObject(uint32_t key, ...@@ -6637,9 +6660,6 @@ uint32_t SeededNumberDictionaryShape::SeededHashForObject(uint32_t key,
return ComputeIntegerHash(static_cast<uint32_t>(other->Number()), seed); return ComputeIntegerHash(static_cast<uint32_t>(other->Number()), seed);
} }
MaybeObject* NumberDictionaryShape::AsObject(Heap* heap, uint32_t key) {
return heap->NumberFromUint32(key);
}
Handle<Object> NumberDictionaryShape::AsHandle(Isolate* isolate, uint32_t key) { Handle<Object> NumberDictionaryShape::AsHandle(Isolate* isolate, uint32_t key) {
return isolate->factory()->NewNumberFromUint(key); return isolate->factory()->NewNumberFromUint(key);
...@@ -6664,12 +6684,6 @@ uint32_t NameDictionaryShape::HashForObject(Handle<Name> key, Object* other) { ...@@ -6664,12 +6684,6 @@ uint32_t NameDictionaryShape::HashForObject(Handle<Name> key, Object* other) {
} }
MaybeObject* NameDictionaryShape::AsObject(Heap* heap, Handle<Name> key) {
ASSERT(key->IsUniqueName());
return *key;
}
Handle<Object> NameDictionaryShape::AsHandle(Isolate* isolate, Handle<Object> NameDictionaryShape::AsHandle(Isolate* isolate,
Handle<Name> key) { Handle<Name> key) {
ASSERT(key->IsUniqueName()); ASSERT(key->IsUniqueName());
...@@ -6699,11 +6713,6 @@ uint32_t ObjectHashTableShape::HashForObject(Handle<Object> key, ...@@ -6699,11 +6713,6 @@ uint32_t ObjectHashTableShape::HashForObject(Handle<Object> key,
} }
MaybeObject* ObjectHashTableShape::AsObject(Heap* heap, Handle<Object> key) {
return *key;
}
Handle<Object> ObjectHashTableShape::AsHandle(Isolate* isolate, Handle<Object> ObjectHashTableShape::AsHandle(Isolate* isolate,
Handle<Object> key) { Handle<Object> key) {
return key; return key;
......
...@@ -3866,16 +3866,16 @@ class StringTableShape : public BaseShape<HashTableKey*> { ...@@ -3866,16 +3866,16 @@ class StringTableShape : public BaseShape<HashTableKey*> {
static inline bool IsMatch(HashTableKey* key, Object* value) { static inline bool IsMatch(HashTableKey* key, Object* value) {
return key->IsMatch(value); return key->IsMatch(value);
} }
static inline uint32_t Hash(HashTableKey* key) { static inline uint32_t Hash(HashTableKey* key) {
return key->Hash(); return key->Hash();
} }
static inline uint32_t HashForObject(HashTableKey* key, Object* object) { static inline uint32_t HashForObject(HashTableKey* key, Object* object) {
return key->HashForObject(object); return key->HashForObject(object);
} }
MUST_USE_RESULT static inline MaybeObject* AsObject(Heap* heap,
HashTableKey* key) { static inline Handle<Object> AsHandle(Isolate* isolate, HashTableKey* key);
return key->AsObject(heap);
}
static const int kPrefixSize = 0; static const int kPrefixSize = 0;
static const int kEntrySize = 1; static const int kEntrySize = 1;
...@@ -3919,6 +3919,7 @@ class MapCacheShape : public BaseShape<HashTableKey*> { ...@@ -3919,6 +3919,7 @@ class MapCacheShape : public BaseShape<HashTableKey*> {
static inline bool IsMatch(HashTableKey* key, Object* value) { static inline bool IsMatch(HashTableKey* key, Object* value) {
return key->IsMatch(value); return key->IsMatch(value);
} }
static inline uint32_t Hash(HashTableKey* key) { static inline uint32_t Hash(HashTableKey* key) {
return key->Hash(); return key->Hash();
} }
...@@ -3927,10 +3928,7 @@ class MapCacheShape : public BaseShape<HashTableKey*> { ...@@ -3927,10 +3928,7 @@ class MapCacheShape : public BaseShape<HashTableKey*> {
return key->HashForObject(object); return key->HashForObject(object);
} }
MUST_USE_RESULT static inline MaybeObject* AsObject(Heap* heap, static inline Handle<Object> AsHandle(Isolate* isolate, HashTableKey* key);
HashTableKey* key) {
return key->AsObject(heap);
}
static const int kPrefixSize = 0; static const int kPrefixSize = 0;
static const int kEntrySize = 2; static const int kEntrySize = 2;
...@@ -4087,8 +4085,6 @@ class NameDictionaryShape : public BaseShape<Handle<Name> > { ...@@ -4087,8 +4085,6 @@ class NameDictionaryShape : public BaseShape<Handle<Name> > {
static inline bool IsMatch(Handle<Name> key, Object* other); static inline bool IsMatch(Handle<Name> key, Object* other);
static inline uint32_t Hash(Handle<Name> key); static inline uint32_t Hash(Handle<Name> key);
static inline uint32_t HashForObject(Handle<Name> key, Object* object); static inline uint32_t HashForObject(Handle<Name> key, Object* object);
MUST_USE_RESULT static inline MaybeObject* AsObject(Heap* heap,
Handle<Name> key);
static inline Handle<Object> AsHandle(Isolate* isolate, Handle<Name> key); static inline Handle<Object> AsHandle(Isolate* isolate, Handle<Name> key);
static const int kPrefixSize = 2; static const int kPrefixSize = 2;
static const int kEntrySize = 3; static const int kEntrySize = 3;
...@@ -4125,9 +4121,6 @@ class NameDictionary: public Dictionary<NameDictionary, ...@@ -4125,9 +4121,6 @@ class NameDictionary: public Dictionary<NameDictionary,
class NumberDictionaryShape : public BaseShape<uint32_t> { class NumberDictionaryShape : public BaseShape<uint32_t> {
public: public:
static inline bool IsMatch(uint32_t key, Object* other); 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<Object> AsHandle(Isolate* isolate, uint32_t key); static inline Handle<Object> AsHandle(Isolate* isolate, uint32_t key);
static const int kEntrySize = 3; static const int kEntrySize = 3;
static const bool kIsEnumerable = false; static const bool kIsEnumerable = false;
...@@ -4240,8 +4233,6 @@ class ObjectHashTableShape : public BaseShape<Handle<Object> > { ...@@ -4240,8 +4233,6 @@ class ObjectHashTableShape : public BaseShape<Handle<Object> > {
static inline bool IsMatch(Handle<Object> key, Object* other); static inline bool IsMatch(Handle<Object> key, Object* other);
static inline uint32_t Hash(Handle<Object> key); static inline uint32_t Hash(Handle<Object> key);
static inline uint32_t HashForObject(Handle<Object> key, Object* object); static inline uint32_t HashForObject(Handle<Object> key, Object* object);
MUST_USE_RESULT static inline MaybeObject* AsObject(Heap* heap,
Handle<Object> key);
static inline Handle<Object> AsHandle(Isolate* isolate, Handle<Object> key); static inline Handle<Object> AsHandle(Isolate* isolate, Handle<Object> key);
static const int kPrefixSize = 0; static const int kPrefixSize = 0;
static const int kEntrySize = 2; static const int kEntrySize = 2;
...@@ -8280,10 +8271,7 @@ class CompilationCacheShape : public BaseShape<HashTableKey*> { ...@@ -8280,10 +8271,7 @@ class CompilationCacheShape : public BaseShape<HashTableKey*> {
return key->HashForObject(object); return key->HashForObject(object);
} }
MUST_USE_RESULT static MaybeObject* AsObject(Heap* heap, static inline Handle<Object> AsHandle(Isolate* isolate, HashTableKey* key);
HashTableKey* key) {
return key->AsObject(heap);
}
static const int kPrefixSize = 0; static const int kPrefixSize = 0;
static const int kEntrySize = 2; static const int kEntrySize = 2;
...@@ -8383,10 +8371,7 @@ class CodeCacheHashTableShape : public BaseShape<HashTableKey*> { ...@@ -8383,10 +8371,7 @@ class CodeCacheHashTableShape : public BaseShape<HashTableKey*> {
return key->HashForObject(object); return key->HashForObject(object);
} }
MUST_USE_RESULT static MaybeObject* AsObject(Heap* heap, static inline Handle<Object> AsHandle(Isolate* isolate, HashTableKey* key);
HashTableKey* key) {
return key->AsObject(heap);
}
static const int kPrefixSize = 0; static const int kPrefixSize = 0;
static const int kEntrySize = 2; static const int kEntrySize = 2;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment