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

Unified Diff: src/objects-inl.h

Issue 7385006: Reintroduced dictionary that can use objects as keys. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Incorporated review from Vitaly Repeshko. Created 9 years, 5 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
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 0d83c4794666f1ed6e4b72bd1b74e8933e0d839b..99e053e77945ce977e802db301b45f3f955b9ca9 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -4356,6 +4356,32 @@ MaybeObject* StringDictionaryShape::AsObject(String* key) {
}
+bool ObjectDictionaryShape::IsMatch(JSObject* key, Object* other) {
+ ASSERT(other->IsJSObject());
Vitaly Repeshko 2011/07/26 13:53:14 JSObject::cast does the same assert.
Michael Starzinger 2011/07/26 22:30:23 Fixed.
+ return key == JSObject::cast(other);
+}
+
+
+uint32_t ObjectDictionaryShape::Hash(JSObject* key) {
+ MaybeObject* maybe_hash = key->GetIdentityHash();
+ ASSERT(!maybe_hash->IsFailure());
+ return Smi::cast(maybe_hash->ToObjectUnchecked())->value();
+}
+
+
+uint32_t ObjectDictionaryShape::HashForObject(JSObject* key, Object* other) {
+ ASSERT(other->IsJSObject());
Vitaly Repeshko 2011/07/26 13:53:14 Ditto.
Michael Starzinger 2011/07/26 22:30:23 Fixed.
+ MaybeObject* maybe_hash = JSObject::cast(other)->GetIdentityHash();
+ ASSERT(!maybe_hash->IsFailure());
+ return Smi::cast(maybe_hash->ToObjectUnchecked())->value();
+}
+
+
+MaybeObject* ObjectDictionaryShape::AsObject(JSObject* key) {
+ return key;
+}
+
+
void Map::ClearCodeCache(Heap* heap) {
// No write barrier is needed since empty_fixed_array is not in new space.
// Please note this function is used during marking:

Powered by Google App Engine
This is Rietveld 408576698