Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(813)

Unified Diff: src/objects-inl.h

Issue 257853003: ObjectHashTable's key and WeakHashTable's key types are now Handle<Object> instead of Object*. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.cc ('k') | test/cctest/test-dictionary.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 6807ad434ee1fd3289b0faddbba21e8361c67a29..19457858fb3abda3aad8af946a86eb7ca934d871 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -6685,47 +6685,54 @@ void NameDictionary::DoGenerateNewEnumerationIndices(
}
-bool ObjectHashTableShape::IsMatch(Object* key, Object* other) {
+bool ObjectHashTableShape::IsMatch(Handle<Object> key, Object* other) {
return key->SameValue(other);
}
-uint32_t ObjectHashTableShape::Hash(Object* key) {
+uint32_t ObjectHashTableShape::Hash(Handle<Object> key) {
return Smi::cast(key->GetHash())->value();
}
-uint32_t ObjectHashTableShape::HashForObject(Object* key, Object* other) {
+uint32_t ObjectHashTableShape::HashForObject(Handle<Object> key,
+ Object* other) {
return Smi::cast(other->GetHash())->value();
}
-MaybeObject* ObjectHashTableShape::AsObject(Heap* heap, Object* key) {
+MaybeObject* ObjectHashTableShape::AsObject(Heap* heap, Handle<Object> key) {
+ return *key;
+}
+
+
+Handle<Object> ObjectHashTableShape::AsHandle(Isolate* isolate,
+ Handle<Object> key) {
return key;
}
Handle<ObjectHashTable> ObjectHashTable::Shrink(
Handle<ObjectHashTable> table, Handle<Object> key) {
- return DerivedHashTable::Shrink(table, *key);
+ return DerivedHashTable::Shrink(table, key);
}
template <int entrysize>
-bool WeakHashTableShape<entrysize>::IsMatch(Object* key, Object* other) {
+bool WeakHashTableShape<entrysize>::IsMatch(Handle<Object> key, Object* other) {
return key->SameValue(other);
}
template <int entrysize>
-uint32_t WeakHashTableShape<entrysize>::Hash(Object* key) {
- intptr_t hash = reinterpret_cast<intptr_t>(key);
+uint32_t WeakHashTableShape<entrysize>::Hash(Handle<Object> key) {
+ intptr_t hash = reinterpret_cast<intptr_t>(*key);
return (uint32_t)(hash & 0xFFFFFFFF);
}
template <int entrysize>
-uint32_t WeakHashTableShape<entrysize>::HashForObject(Object* key,
+uint32_t WeakHashTableShape<entrysize>::HashForObject(Handle<Object> key,
Object* other) {
intptr_t hash = reinterpret_cast<intptr_t>(other);
return (uint32_t)(hash & 0xFFFFFFFF);
@@ -6733,8 +6740,8 @@ uint32_t WeakHashTableShape<entrysize>::HashForObject(Object* key,
template <int entrysize>
-MaybeObject* WeakHashTableShape<entrysize>::AsObject(Heap* heap,
- Object* key) {
+Handle<Object> WeakHashTableShape<entrysize>::AsHandle(Isolate* isolate,
+ Handle<Object> key) {
return key;
}
« no previous file with comments | « src/objects.cc ('k') | test/cctest/test-dictionary.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698