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

Side by Side Diff: src/objects.h

Issue 1705713002: [runtime] Replace hidden_string with a 0-hash-code private symbol (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 2175 matching lines...) Expand 10 before | Expand all | Expand 10 after
2186 Handle<AccessorInfo> info); 2186 Handle<AccessorInfo> info);
2187 2187
2188 // The result must be checked first for exceptions. If there's no exception, 2188 // The result must be checked first for exceptions. If there's no exception,
2189 // the output parameter |done| indicates whether the interceptor has a result 2189 // the output parameter |done| indicates whether the interceptor has a result
2190 // or not. 2190 // or not.
2191 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithInterceptor( 2191 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithInterceptor(
2192 LookupIterator* it, bool* done); 2192 LookupIterator* it, bool* done);
2193 2193
2194 // Accessors for hidden properties object. 2194 // Accessors for hidden properties object.
2195 // 2195 //
2196 // Hidden properties are not own properties of the object itself. 2196 // Hidden properties are not own properties of the object itself. Instead
2197 // Instead they are stored in an auxiliary structure kept as an own 2197 // they are stored in an auxiliary structure kept as an own property with a
2198 // property with a special name Heap::hidden_string(). But if the 2198 // special name Heap::hidden_properties_symbol(). But if the receiver is a
2199 // receiver is a JSGlobalProxy then the auxiliary object is a property 2199 // JSGlobalProxy then the auxiliary object is a property of its prototype, and
2200 // of its prototype, and if it's a detached proxy, then you can't have 2200 // if it's a detached proxy, then you can't have hidden properties.
2201 // hidden properties.
2202 2201
2203 // Sets a hidden property on this object. Returns this object if successful, 2202 // Sets a hidden property on this object. Returns this object if successful,
2204 // undefined if called on a detached proxy. 2203 // undefined if called on a detached proxy.
2205 static Handle<Object> SetHiddenProperty(Handle<JSObject> object, 2204 static Handle<Object> SetHiddenProperty(Handle<JSObject> object,
2206 Handle<Name> key, 2205 Handle<Name> key,
2207 Handle<Object> value); 2206 Handle<Object> value);
2208 // Gets the value of a hidden property with the given key. Returns the hole 2207 // Gets the value of a hidden property with the given key. Returns the hole
2209 // if the property doesn't exist (or if called on a detached proxy), 2208 // if the property doesn't exist (or if called on a detached proxy),
2210 // otherwise returns the value set for the key. 2209 // otherwise returns the value set for the key.
2211 Object* GetHiddenProperty(Handle<Name> key); 2210 Object* GetHiddenProperty(Handle<Name> key);
(...skipping 6759 matching lines...) Expand 10 before | Expand all | Expand 10 after
8971 static const int kMaxArrayIndexSize = 10; 8970 static const int kMaxArrayIndexSize = 10;
8972 STATIC_ASSERT(kMaxArrayIndexSize < (1 << kArrayIndexLengthBits)); 8971 STATIC_ASSERT(kMaxArrayIndexSize < (1 << kArrayIndexLengthBits));
8973 8972
8974 // Max char codes. 8973 // Max char codes.
8975 static const int32_t kMaxOneByteCharCode = unibrow::Latin1::kMaxChar; 8974 static const int32_t kMaxOneByteCharCode = unibrow::Latin1::kMaxChar;
8976 static const uint32_t kMaxOneByteCharCodeU = unibrow::Latin1::kMaxChar; 8975 static const uint32_t kMaxOneByteCharCodeU = unibrow::Latin1::kMaxChar;
8977 static const int kMaxUtf16CodeUnit = 0xffff; 8976 static const int kMaxUtf16CodeUnit = 0xffff;
8978 static const uint32_t kMaxUtf16CodeUnitU = kMaxUtf16CodeUnit; 8977 static const uint32_t kMaxUtf16CodeUnitU = kMaxUtf16CodeUnit;
8979 static const uc32 kMaxCodePoint = 0x10ffff; 8978 static const uc32 kMaxCodePoint = 0x10ffff;
8980 8979
8981 // Value of hash field containing computed hash equal to zero.
8982 static const int kEmptyStringHash = kIsNotArrayIndexMask;
8983
8984 // Maximal string length. 8980 // Maximal string length.
8985 static const int kMaxLength = (1 << 28) - 16; 8981 static const int kMaxLength = (1 << 28) - 16;
8986 8982
8987 // Max length for computing hash. For strings longer than this limit the 8983 // Max length for computing hash. For strings longer than this limit the
8988 // string length is used as the hash value. 8984 // string length is used as the hash value.
8989 static const int kMaxHashCalcLength = 16383; 8985 static const int kMaxHashCalcLength = 16383;
8990 8986
8991 // Limit for truncation in short printing. 8987 // Limit for truncation in short printing.
8992 static const int kMaxShortPrintLength = 1024; 8988 static const int kMaxShortPrintLength = 1024;
8993 8989
(...skipping 1854 matching lines...) Expand 10 before | Expand all | Expand 10 after
10848 } 10844 }
10849 return value; 10845 return value;
10850 } 10846 }
10851 }; 10847 };
10852 10848
10853 10849
10854 } // NOLINT, false-positive due to second-order macros. 10850 } // NOLINT, false-positive due to second-order macros.
10855 } // NOLINT, false-positive due to second-order macros. 10851 } // NOLINT, false-positive due to second-order macros.
10856 10852
10857 #endif // V8_OBJECTS_H_ 10853 #endif // V8_OBJECTS_H_
OLDNEW
« src/heap/heap.cc ('K') | « src/lookup.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698