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

Side by Side Diff: src/objects-inl.h

Issue 225183009: Use OrderedHashTables as the backing store of JSSet and JSMap (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Get rid of IsOrderedHashSet/Map methods 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects-debug.cc ('k') | src/runtime.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 bool Object::IsMapCache() { 913 bool Object::IsMapCache() {
914 return IsHashTable(); 914 return IsHashTable();
915 } 915 }
916 916
917 917
918 bool Object::IsObjectHashTable() { 918 bool Object::IsObjectHashTable() {
919 return IsHashTable(); 919 return IsHashTable();
920 } 920 }
921 921
922 922
923 bool Object::IsOrderedHashTable() {
924 return IsHeapObject() &&
925 HeapObject::cast(this)->map() ==
926 HeapObject::cast(this)->GetHeap()->ordered_hash_table_map();
927 }
928
929
923 bool Object::IsPrimitive() { 930 bool Object::IsPrimitive() {
924 return IsOddball() || IsNumber() || IsString(); 931 return IsOddball() || IsNumber() || IsString();
925 } 932 }
926 933
927 934
928 bool Object::IsJSGlobalProxy() { 935 bool Object::IsJSGlobalProxy() {
929 bool result = IsHeapObject() && 936 bool result = IsHeapObject() &&
930 (HeapObject::cast(this)->map()->instance_type() == 937 (HeapObject::cast(this)->map()->instance_type() ==
931 JS_GLOBAL_PROXY_TYPE); 938 JS_GLOBAL_PROXY_TYPE);
932 ASSERT(!result || 939 ASSERT(!result ||
(...skipping 5648 matching lines...) Expand 10 before | Expand all | Expand 10 after
6581 return Name::cast(other)->Hash(); 6588 return Name::cast(other)->Hash();
6582 } 6589 }
6583 6590
6584 6591
6585 MaybeObject* NameDictionaryShape::AsObject(Heap* heap, Name* key) { 6592 MaybeObject* NameDictionaryShape::AsObject(Heap* heap, Name* key) {
6586 ASSERT(key->IsUniqueName()); 6593 ASSERT(key->IsUniqueName());
6587 return key; 6594 return key;
6588 } 6595 }
6589 6596
6590 6597
6591 template <int entrysize> 6598 bool ObjectHashTableShape::IsMatch(Object* key, Object* other) {
6592 bool ObjectHashTableShape<entrysize>::IsMatch(Object* key, Object* other) {
6593 return key->SameValue(other); 6599 return key->SameValue(other);
6594 } 6600 }
6595 6601
6596 6602
6597 template <int entrysize> 6603 uint32_t ObjectHashTableShape::Hash(Object* key) {
6598 uint32_t ObjectHashTableShape<entrysize>::Hash(Object* key) {
6599 return Smi::cast(key->GetHash())->value(); 6604 return Smi::cast(key->GetHash())->value();
6600 } 6605 }
6601 6606
6602 6607
6603 template <int entrysize> 6608 uint32_t ObjectHashTableShape::HashForObject(Object* key, Object* other) {
6604 uint32_t ObjectHashTableShape<entrysize>::HashForObject(Object* key,
6605 Object* other) {
6606 return Smi::cast(other->GetHash())->value(); 6609 return Smi::cast(other->GetHash())->value();
6607 } 6610 }
6608 6611
6609 6612
6610 template <int entrysize> 6613 MaybeObject* ObjectHashTableShape::AsObject(Heap* heap, Object* key) {
6611 MaybeObject* ObjectHashTableShape<entrysize>::AsObject(Heap* heap,
6612 Object* key) {
6613 return key; 6614 return key;
6614 } 6615 }
6615 6616
6616 6617
6617 template <int entrysize> 6618 template <int entrysize>
6618 bool WeakHashTableShape<entrysize>::IsMatch(Object* key, Object* other) { 6619 bool WeakHashTableShape<entrysize>::IsMatch(Object* key, Object* other) {
6619 return key->SameValue(other); 6620 return key->SameValue(other);
6620 } 6621 }
6621 6622
6622 6623
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
6924 #undef READ_UINT32_FIELD 6925 #undef READ_UINT32_FIELD
6925 #undef WRITE_UINT32_FIELD 6926 #undef WRITE_UINT32_FIELD
6926 #undef READ_SHORT_FIELD 6927 #undef READ_SHORT_FIELD
6927 #undef WRITE_SHORT_FIELD 6928 #undef WRITE_SHORT_FIELD
6928 #undef READ_BYTE_FIELD 6929 #undef READ_BYTE_FIELD
6929 #undef WRITE_BYTE_FIELD 6930 #undef WRITE_BYTE_FIELD
6930 6931
6931 } } // namespace v8::internal 6932 } } // namespace v8::internal
6932 6933
6933 #endif // V8_OBJECTS_INL_H_ 6934 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects-debug.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698