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

Unified Diff: src/objects.h

Issue 2081733002: [keys] support shadowing keys in the KeyAccumulator (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebasing Created 4 years, 6 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.h
diff --git a/src/objects.h b/src/objects.h
index 43671a677ae769eed05ce29a506df03a7b958c1c..cd646851a7373535f5487dbd6265879eb65eae55 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -888,121 +888,122 @@ template <class C> inline bool Is(Object* obj);
V(Primitive) \
V(Number)
-#define HEAP_OBJECT_TYPE_LIST(V) \
- V(HeapNumber) \
- V(MutableHeapNumber) \
- V(Simd128Value) \
- V(Float32x4) \
- V(Int32x4) \
- V(Uint32x4) \
- V(Bool32x4) \
- V(Int16x8) \
- V(Uint16x8) \
- V(Bool16x8) \
- V(Int8x16) \
- V(Uint8x16) \
- V(Bool8x16) \
- V(Name) \
- V(UniqueName) \
- V(String) \
- V(SeqString) \
- V(ExternalString) \
- V(ConsString) \
- V(SlicedString) \
- V(ExternalTwoByteString) \
- V(ExternalOneByteString) \
- V(SeqTwoByteString) \
- V(SeqOneByteString) \
- V(InternalizedString) \
- V(Symbol) \
- \
- V(FixedTypedArrayBase) \
- V(FixedUint8Array) \
- V(FixedInt8Array) \
- V(FixedUint16Array) \
- V(FixedInt16Array) \
- V(FixedUint32Array) \
- V(FixedInt32Array) \
- V(FixedFloat32Array) \
- V(FixedFloat64Array) \
- V(FixedUint8ClampedArray) \
- V(ByteArray) \
- V(BytecodeArray) \
- V(FreeSpace) \
- V(JSReceiver) \
- V(JSObject) \
- V(JSContextExtensionObject) \
- V(JSGeneratorObject) \
- V(JSModule) \
- V(Map) \
- V(DescriptorArray) \
- V(TransitionArray) \
- V(LiteralsArray) \
- V(TypeFeedbackMetadata) \
- V(TypeFeedbackVector) \
- V(DeoptimizationInputData) \
- V(DeoptimizationOutputData) \
- V(DependentCode) \
- V(HandlerTable) \
- V(FixedArray) \
- V(FixedDoubleArray) \
- V(WeakFixedArray) \
- V(ArrayList) \
- V(Context) \
- V(ScriptContextTable) \
- V(NativeContext) \
- V(ScopeInfo) \
- V(JSBoundFunction) \
- V(JSFunction) \
- V(Code) \
- V(AbstractCode) \
- V(Oddball) \
- V(SharedFunctionInfo) \
- V(JSValue) \
- V(JSDate) \
- V(JSMessageObject) \
- V(StringWrapper) \
- V(Foreign) \
- V(Boolean) \
- V(JSArray) \
- V(JSArrayBuffer) \
- V(JSArrayBufferView) \
- V(JSTypedArray) \
- V(JSDataView) \
- V(JSProxy) \
- V(JSSet) \
- V(JSMap) \
- V(JSSetIterator) \
- V(JSMapIterator) \
- V(JSWeakCollection) \
- V(JSWeakMap) \
- V(JSWeakSet) \
- V(JSRegExp) \
- V(HashTable) \
- V(Dictionary) \
- V(StringTable) \
- V(StringSet) \
- V(NormalizedMapCache) \
- V(CompilationCacheTable) \
- V(CodeCacheHashTable) \
- V(MapCache) \
- V(JSGlobalObject) \
- V(JSGlobalProxy) \
- V(Undetectable) \
- V(AccessCheckNeeded) \
- V(Callable) \
- V(Function) \
- V(Constructor) \
- V(TemplateInfo) \
- V(Filler) \
- V(FixedArrayBase) \
- V(External) \
- V(Struct) \
- V(Cell) \
- V(PropertyCell) \
- V(WeakCell) \
- V(ObjectHashTable) \
- V(WeakHashTable) \
+#define HEAP_OBJECT_TYPE_LIST(V) \
+ V(HeapNumber) \
+ V(MutableHeapNumber) \
+ V(Simd128Value) \
+ V(Float32x4) \
+ V(Int32x4) \
+ V(Uint32x4) \
+ V(Bool32x4) \
+ V(Int16x8) \
+ V(Uint16x8) \
+ V(Bool16x8) \
+ V(Int8x16) \
+ V(Uint8x16) \
+ V(Bool8x16) \
+ V(Name) \
+ V(UniqueName) \
+ V(String) \
+ V(SeqString) \
+ V(ExternalString) \
+ V(ConsString) \
+ V(SlicedString) \
+ V(ExternalTwoByteString) \
+ V(ExternalOneByteString) \
+ V(SeqTwoByteString) \
+ V(SeqOneByteString) \
+ V(InternalizedString) \
+ V(Symbol) \
+ \
+ V(FixedTypedArrayBase) \
+ V(FixedUint8Array) \
+ V(FixedInt8Array) \
+ V(FixedUint16Array) \
+ V(FixedInt16Array) \
+ V(FixedUint32Array) \
+ V(FixedInt32Array) \
+ V(FixedFloat32Array) \
+ V(FixedFloat64Array) \
+ V(FixedUint8ClampedArray) \
+ V(ByteArray) \
+ V(BytecodeArray) \
+ V(FreeSpace) \
+ V(JSReceiver) \
+ V(JSObject) \
+ V(JSContextExtensionObject) \
+ V(JSGeneratorObject) \
+ V(JSModule) \
+ V(Map) \
+ V(DescriptorArray) \
+ V(TransitionArray) \
+ V(LiteralsArray) \
+ V(TypeFeedbackMetadata) \
+ V(TypeFeedbackVector) \
+ V(DeoptimizationInputData) \
+ V(DeoptimizationOutputData) \
+ V(DependentCode) \
+ V(HandlerTable) \
+ V(FixedArray) \
+ V(FixedDoubleArray) \
+ V(WeakFixedArray) \
+ V(ArrayList) \
+ V(Context) \
+ V(ScriptContextTable) \
+ V(NativeContext) \
+ V(ScopeInfo) \
+ V(JSBoundFunction) \
+ V(JSFunction) \
+ V(Code) \
+ V(AbstractCode) \
+ V(Oddball) \
+ V(SharedFunctionInfo) \
+ V(JSValue) \
+ V(JSDate) \
+ V(JSMessageObject) \
+ V(StringWrapper) \
+ V(Foreign) \
+ V(Boolean) \
+ V(JSArray) \
+ V(JSArrayBuffer) \
+ V(JSArrayBufferView) \
+ V(JSTypedArray) \
+ V(JSDataView) \
+ V(JSProxy) \
+ V(JSSet) \
+ V(JSMap) \
+ V(JSSetIterator) \
+ V(JSMapIterator) \
+ V(JSWeakCollection) \
+ V(JSWeakMap) \
+ V(JSWeakSet) \
+ V(JSRegExp) \
+ V(HashTable) \
+ V(Dictionary) \
+ V(StringTable) \
+ V(StringSet) \
+ V(NormalizedMapCache) \
+ V(CompilationCacheTable) \
+ V(CodeCacheHashTable) \
+ V(MapCache) \
+ V(JSGlobalObject) \
+ V(JSGlobalProxy) \
+ V(Undetectable) \
+ V(AccessCheckNeeded) \
+ V(Callable) \
+ V(Function) \
+ V(Constructor) \
+ V(TemplateInfo) \
+ V(Filler) \
+ V(FixedArrayBase) \
+ V(External) \
+ V(Struct) \
+ V(Cell) \
+ V(PropertyCell) \
+ V(WeakCell) \
+ V(ObjectHashTable) \
+ V(ObjectHashSet) \
+ V(WeakHashTable) \
V(OrderedHashTable)
#define ODDBALL_LIST(V) \
@@ -3233,6 +3234,8 @@ class HashTable : public HashTableBase {
inline int FindEntry(Key key);
inline int FindEntry(Isolate* isolate, Key key, int32_t hash);
int FindEntry(Isolate* isolate, Key key);
+ inline bool Has(Isolate* isolate, Key key);
+ inline bool Has(Key key);
// Rehashes the table in-place.
void Rehash(Key key);
@@ -3457,11 +3460,13 @@ class Dictionary: public HashTable<Derived, Shape, Key> {
// Collect the keys into the given KeyAccumulator, in ascending chronological
// order of property creation.
- static void CollectKeysTo(Handle<Dictionary<Derived, Shape, Key> > dictionary,
- KeyAccumulator* keys, PropertyFilter filter);
+ static void CollectKeysTo(Handle<Dictionary<Derived, Shape, Key>> dictionary,
+ KeyAccumulator* keys);
// Copies enumerable keys to preallocated fixed array.
- void CopyEnumKeysTo(FixedArray* storage);
+ static void CopyEnumKeysTo(Handle<Dictionary<Derived, Shape, Key>> dictionary,
+ Handle<FixedArray> storage, KeyCollectionMode mode,
+ KeyAccumulator* accumulator);
// Accessors for next enumeration index.
void SetNextEnumerationIndex(int index) {
@@ -3793,6 +3798,23 @@ class ObjectHashTable: public HashTable<ObjectHashTable,
}
};
+class ObjectHashSetShape : public ObjectHashTableShape {
+ public:
+ static const int kPrefixSize = 0;
+ static const int kEntrySize = 1;
+};
+
+class ObjectHashSet
+ : public HashTable<ObjectHashSet, ObjectHashSetShape, Handle<Object>> {
+ public:
+ static Handle<ObjectHashSet> Add(Handle<ObjectHashSet> set,
+ Handle<Object> key);
+
+ inline bool Has(Isolate* isolate, Handle<Object> key, int32_t hash);
+ inline bool Has(Isolate* isolate, Handle<Object> key);
+
+ DECLARE_CAST(ObjectHashSet)
+};
// OrderedHashTable is a HashTable with Object keys that preserves
// insertion order. There are Map and Set interfaces (OrderedHashMap

Powered by Google App Engine
This is Rietveld 408576698