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

Unified Diff: src/objects.h

Issue 12330012: ES6 symbols: Allow symbols as property names (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Platform ports Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/log.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 283fc69838229cb190c167c2a926fc5b9d387071..02dbe9fe4e53b2af3685fc7592ec6338cd6d26e2 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -925,8 +925,6 @@ class MaybeObject BASE_EMBEDDED {
V(ObjectHashTable) \
-class JSReceiver;
-
// Object is the abstract superclass for all classes in the
// object hierarchy.
// Object does not use any virtual functions to avoid the
@@ -991,28 +989,28 @@ class Object : public MaybeObject {
// Failure is returned otherwise.
MUST_USE_RESULT inline MaybeObject* ToSmi();
- void Lookup(String* name, LookupResult* result);
+ void Lookup(Name* name, LookupResult* result);
// Property access.
- MUST_USE_RESULT inline MaybeObject* GetProperty(String* key);
+ MUST_USE_RESULT inline MaybeObject* GetProperty(Name* key);
MUST_USE_RESULT inline MaybeObject* GetProperty(
- String* key,
+ Name* key,
PropertyAttributes* attributes);
MUST_USE_RESULT MaybeObject* GetPropertyWithReceiver(
Object* receiver,
- String* key,
+ Name* key,
PropertyAttributes* attributes);
- static Handle<Object> GetProperty(Handle<Object> object, Handle<String> key);
+ static Handle<Object> GetProperty(Handle<Object> object, Handle<Name> key);
static Handle<Object> GetProperty(Handle<Object> object,
Handle<Object> receiver,
LookupResult* result,
- Handle<String> key,
+ Handle<Name> key,
PropertyAttributes* attributes);
MUST_USE_RESULT MaybeObject* GetProperty(Object* receiver,
LookupResult* result,
- String* key,
+ Name* key,
PropertyAttributes* attributes);
MUST_USE_RESULT MaybeObject* GetPropertyWithDefinedGetter(Object* receiver,
@@ -1479,20 +1477,20 @@ class JSReceiver: public HeapObject {
static inline JSReceiver* cast(Object* obj);
static Handle<Object> SetProperty(Handle<JSReceiver> object,
- Handle<String> key,
+ Handle<Name> key,
Handle<Object> value,
PropertyAttributes attributes,
StrictModeFlag strict_mode);
// Can cause GC.
MUST_USE_RESULT MaybeObject* SetProperty(
- String* key,
+ Name* key,
Object* value,
PropertyAttributes attributes,
StrictModeFlag strict_mode,
StoreFromKeyed store_from_keyed = MAY_BE_STORE_FROM_KEYED);
MUST_USE_RESULT MaybeObject* SetProperty(
LookupResult* result,
- String* key,
+ Name* key,
Object* value,
PropertyAttributes attributes,
StrictModeFlag strict_mode,
@@ -1500,7 +1498,7 @@ class JSReceiver: public HeapObject {
MUST_USE_RESULT MaybeObject* SetPropertyWithDefinedSetter(JSReceiver* setter,
Object* value);
- MUST_USE_RESULT MaybeObject* DeleteProperty(String* name, DeleteMode mode);
+ MUST_USE_RESULT MaybeObject* DeleteProperty(Name* name, DeleteMode mode);
MUST_USE_RESULT MaybeObject* DeleteElement(uint32_t index, DeleteMode mode);
// Set the index'th array element.
@@ -1521,17 +1519,17 @@ class JSReceiver: public HeapObject {
// function that was used to instantiate the object).
String* constructor_name();
- inline PropertyAttributes GetPropertyAttribute(String* name);
+ inline PropertyAttributes GetPropertyAttribute(Name* name);
PropertyAttributes GetPropertyAttributeWithReceiver(JSReceiver* receiver,
- String* name);
- PropertyAttributes GetLocalPropertyAttribute(String* name);
+ Name* name);
+ PropertyAttributes GetLocalPropertyAttribute(Name* name);
inline PropertyAttributes GetElementAttribute(uint32_t index);
inline PropertyAttributes GetLocalElementAttribute(uint32_t index);
// Can cause a GC.
- inline bool HasProperty(String* name);
- inline bool HasLocalProperty(String* name);
+ inline bool HasProperty(Name* name);
+ inline bool HasLocalProperty(Name* name);
inline bool HasElement(uint32_t index);
inline bool HasLocalElement(uint32_t index);
@@ -1551,9 +1549,9 @@ class JSReceiver: public HeapObject {
// Lookup a property. If found, the result is valid and has
// detailed information.
- void LocalLookup(String* name, LookupResult* result,
+ void LocalLookup(Name* name, LookupResult* result,
bool search_hidden_prototypes = false);
- void Lookup(String* name, LookupResult* result);
+ void Lookup(Name* name, LookupResult* result);
protected:
Smi* GenerateIdentityHash();
@@ -1561,7 +1559,7 @@ class JSReceiver: public HeapObject {
private:
PropertyAttributes GetPropertyAttributeForResult(JSReceiver* receiver,
LookupResult* result,
- String* name,
+ Name* name,
bool continue_search);
DISALLOW_IMPLICIT_CONSTRUCTORS(JSReceiver);
@@ -1579,7 +1577,7 @@ class JSObject: public JSReceiver {
DECL_ACCESSORS(properties, FixedArray) // Get and set fast properties.
inline void initialize_properties();
inline bool HasFastProperties();
- inline StringDictionary* property_dictionary(); // Gets slow properties.
+ inline NameDictionary* property_dictionary(); // Gets slow properties.
// [elements]: The elements (properties with names that are integers).
//
@@ -1653,34 +1651,34 @@ class JSObject: public JSReceiver {
MUST_USE_RESULT MaybeObject* GetPropertyWithCallback(Object* receiver,
Object* structure,
- String* name);
+ Name* name);
// Can cause GC.
MUST_USE_RESULT MaybeObject* SetPropertyForResult(LookupResult* result,
- String* key,
+ Name* key,
Object* value,
PropertyAttributes attributes,
StrictModeFlag strict_mode,
StoreFromKeyed store_mode);
MUST_USE_RESULT MaybeObject* SetPropertyWithFailedAccessCheck(
LookupResult* result,
- String* name,
+ Name* name,
Object* value,
bool check_prototype,
StrictModeFlag strict_mode);
MUST_USE_RESULT MaybeObject* SetPropertyWithCallback(
Object* structure,
- String* name,
+ Name* name,
Object* value,
JSObject* holder,
StrictModeFlag strict_mode);
MUST_USE_RESULT MaybeObject* SetPropertyWithInterceptor(
- String* name,
+ Name* name,
Object* value,
PropertyAttributes attributes,
StrictModeFlag strict_mode);
MUST_USE_RESULT MaybeObject* SetPropertyPostInterceptor(
- String* name,
+ Name* name,
Object* value,
PropertyAttributes attributes,
StrictModeFlag strict_mode,
@@ -1688,14 +1686,14 @@ class JSObject: public JSReceiver {
static Handle<Object> SetLocalPropertyIgnoreAttributes(
Handle<JSObject> object,
- Handle<String> key,
+ Handle<Name> key,
Handle<Object> value,
PropertyAttributes attributes);
// Try to follow an existing transition to a field with attributes NONE. The
// return value indicates whether the transition was successful.
static inline bool TryTransitionToField(Handle<JSObject> object,
- Handle<String> key);
+ Handle<Name> key);
inline int LastAddedFieldIndex();
@@ -1706,7 +1704,7 @@ class JSObject: public JSReceiver {
// Can cause GC.
MUST_USE_RESULT MaybeObject* SetLocalPropertyIgnoreAttributes(
- String* key,
+ Name* key,
Object* value,
PropertyAttributes attributes);
@@ -1721,16 +1719,16 @@ class JSObject: public JSReceiver {
// Sets the property value in a normalized object given (key, value, details).
// Handles the special representation of JS global objects.
static Handle<Object> SetNormalizedProperty(Handle<JSObject> object,
- Handle<String> key,
+ Handle<Name> key,
Handle<Object> value,
PropertyDetails details);
- MUST_USE_RESULT MaybeObject* SetNormalizedProperty(String* name,
+ MUST_USE_RESULT MaybeObject* SetNormalizedProperty(Name* name,
Object* value,
PropertyDetails details);
// Deletes the named property in a normalized object.
- MUST_USE_RESULT MaybeObject* DeleteNormalizedProperty(String* name,
+ MUST_USE_RESULT MaybeObject* DeleteNormalizedProperty(Name* name,
DeleteMode mode);
MUST_USE_RESULT MaybeObject* OptimizeAsPrototype();
@@ -1741,27 +1739,27 @@ class JSObject: public JSReceiver {
// Used from JSReceiver.
PropertyAttributes GetPropertyAttributePostInterceptor(JSObject* receiver,
- String* name,
+ Name* name,
bool continue_search);
PropertyAttributes GetPropertyAttributeWithInterceptor(JSObject* receiver,
- String* name,
+ Name* name,
bool continue_search);
PropertyAttributes GetPropertyAttributeWithFailedAccessCheck(
Object* receiver,
LookupResult* result,
- String* name,
+ Name* name,
bool continue_search);
PropertyAttributes GetElementAttributeWithReceiver(JSReceiver* receiver,
uint32_t index,
bool continue_search);
static void DefineAccessor(Handle<JSObject> object,
- Handle<String> name,
+ Handle<Name> name,
Handle<Object> getter,
Handle<Object> setter,
PropertyAttributes attributes);
// Can cause GC.
- MUST_USE_RESULT MaybeObject* DefineAccessor(String* name,
+ MUST_USE_RESULT MaybeObject* DefineAccessor(Name* name,
Object* getter,
Object* setter,
PropertyAttributes attributes);
@@ -1769,11 +1767,11 @@ class JSObject: public JSReceiver {
// Returns a JavaScript null if this was not possible and we have to use the
// slow case. Note that we can fail due to allocations, too.
MUST_USE_RESULT MaybeObject* DefineFastAccessor(
- String* name,
+ Name* name,
AccessorComponent component,
Object* accessor,
PropertyAttributes attributes);
- Object* LookupAccessor(String* name, AccessorComponent component);
+ Object* LookupAccessor(Name* name, AccessorComponent component);
MUST_USE_RESULT MaybeObject* DefineAccessor(AccessorInfo* info);
@@ -1781,19 +1779,19 @@ class JSObject: public JSReceiver {
MUST_USE_RESULT MaybeObject* GetPropertyWithFailedAccessCheck(
Object* receiver,
LookupResult* result,
- String* name,
+ Name* name,
PropertyAttributes* attributes);
MUST_USE_RESULT MaybeObject* GetPropertyWithInterceptor(
Object* receiver,
- String* name,
+ Name* name,
PropertyAttributes* attributes);
MUST_USE_RESULT MaybeObject* GetPropertyPostInterceptor(
Object* receiver,
- String* name,
+ Name* name,
PropertyAttributes* attributes);
MUST_USE_RESULT MaybeObject* GetLocalPropertyPostInterceptor(
Object* receiver,
- String* name,
+ Name* name,
PropertyAttributes* attributes);
// Returns true if this is an instance of an api function and has
@@ -1816,17 +1814,17 @@ class JSObject: public JSReceiver {
// Sets a hidden property on this object. Returns this object if successful,
// undefined if called on a detached proxy.
static Handle<Object> SetHiddenProperty(Handle<JSObject> obj,
- Handle<String> key,
+ Handle<Name> key,
Handle<Object> value);
// Returns a failure if a GC is required.
- MUST_USE_RESULT MaybeObject* SetHiddenProperty(String* key, Object* value);
+ MUST_USE_RESULT MaybeObject* SetHiddenProperty(Name* key, Object* value);
// Gets the value of a hidden property with the given key. Returns undefined
// if the property doesn't exist (or if called on a detached proxy),
// otherwise returns the value set for the key.
- Object* GetHiddenProperty(String* key);
+ Object* GetHiddenProperty(Name* key);
// Deletes a hidden property. Deleting a non-existing property is
// considered successful.
- void DeleteHiddenProperty(String* key);
+ void DeleteHiddenProperty(Name* key);
// Returns true if the object has a property with the hidden string as name.
bool HasHiddenProperties();
@@ -1835,9 +1833,9 @@ class JSObject: public JSReceiver {
MUST_USE_RESULT MaybeObject* SetIdentityHash(Smi* hash, CreationFlag flag);
static Handle<Object> DeleteProperty(Handle<JSObject> obj,
- Handle<String> name);
+ Handle<Name> name);
// Can cause GC.
- MUST_USE_RESULT MaybeObject* DeleteProperty(String* name, DeleteMode mode);
+ MUST_USE_RESULT MaybeObject* DeleteProperty(Name* name, DeleteMode mode);
static Handle<Object> DeleteElement(Handle<JSObject> obj, uint32_t index);
MUST_USE_RESULT MaybeObject* DeleteElement(uint32_t index, DeleteMode mode);
@@ -1881,11 +1879,11 @@ class JSObject: public JSReceiver {
return old_capacity + (old_capacity >> 1) + 16;
}
- PropertyType GetLocalPropertyType(String* name);
+ PropertyType GetLocalPropertyType(Name* name);
PropertyType GetLocalElementType(uint32_t index);
// These methods do not perform access checks!
- AccessorPair* GetLocalPropertyAccessorPair(String* name);
+ AccessorPair* GetLocalPropertyAccessorPair(Name* name);
AccessorPair* GetLocalElementAccessorPair(uint32_t index);
MUST_USE_RESULT MaybeObject* SetFastElement(uint32_t index,
@@ -1958,9 +1956,9 @@ class JSObject: public JSReceiver {
inline bool HasIndexedInterceptor();
// Support functions for v8 api (needed for correct interceptor behavior).
- bool HasRealNamedProperty(String* key);
+ bool HasRealNamedProperty(Name* key);
bool HasRealElementProperty(uint32_t index);
- bool HasRealNamedCallbackProperty(String* key);
+ bool HasRealNamedCallbackProperty(Name* key);
// Get the header size for a JSObject. Used to compute the index of
// internal fields as well as the number of internal fields.
@@ -1973,12 +1971,12 @@ class JSObject: public JSReceiver {
inline void SetInternalField(int index, Smi* value);
// The following lookup functions skip interceptors.
- void LocalLookupRealNamedProperty(String* name, LookupResult* result);
- void LookupRealNamedProperty(String* name, LookupResult* result);
- void LookupRealNamedPropertyInPrototypes(String* name, LookupResult* result);
+ void LocalLookupRealNamedProperty(Name* name, LookupResult* result);
+ void LookupRealNamedProperty(Name* name, LookupResult* result);
+ void LookupRealNamedPropertyInPrototypes(Name* name, LookupResult* result);
MUST_USE_RESULT MaybeObject* SetElementWithCallbackSetterInPrototypes(
uint32_t index, Object* value, bool* found, StrictModeFlag strict_mode);
- void LookupCallbackProperty(String* name, LookupResult* result);
+ void LookupCallbackProperty(Name* name, LookupResult* result);
// Returns the number of properties on this object filtering out properties
// with the specified attributes (ignoring interceptors).
@@ -2005,7 +2003,7 @@ class JSObject: public JSReceiver {
// Add a property to a fast-case object using a map transition to
// new_map.
MUST_USE_RESULT MaybeObject* AddFastPropertyUsingMap(Map* new_map,
- String* name,
+ Name* name,
Object* value,
int field_index);
@@ -2016,12 +2014,12 @@ class JSObject: public JSReceiver {
// This avoids the creation of many maps with the same constant
// function, all orphaned.
MUST_USE_RESULT MaybeObject* AddConstantFunctionProperty(
- String* name,
+ Name* name,
JSFunction* function,
PropertyAttributes attributes);
MUST_USE_RESULT MaybeObject* ReplaceSlowProperty(
- String* name,
+ Name* name,
Object* value,
PropertyAttributes attributes);
@@ -2045,32 +2043,32 @@ class JSObject: public JSReceiver {
// Replaces an existing transition with a transition to a map with a FIELD.
MUST_USE_RESULT MaybeObject* ConvertTransitionToMapTransition(
int transition_index,
- String* name,
+ Name* name,
Object* new_value,
PropertyAttributes attributes);
// Converts a descriptor of any other type to a real field, backed by the
// properties array.
MUST_USE_RESULT MaybeObject* ConvertDescriptorToField(
- String* name,
+ Name* name,
Object* new_value,
PropertyAttributes attributes);
// Add a property to a fast-case object.
MUST_USE_RESULT MaybeObject* AddFastProperty(
- String* name,
+ Name* name,
Object* value,
PropertyAttributes attributes,
StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED);
// Add a property to a slow-case object.
- MUST_USE_RESULT MaybeObject* AddSlowProperty(String* name,
+ MUST_USE_RESULT MaybeObject* AddSlowProperty(Name* name,
Object* value,
PropertyAttributes attributes);
// Add a property to an object. May cause GC.
MUST_USE_RESULT MaybeObject* AddProperty(
- String* name,
+ Name* name,
Object* value,
PropertyAttributes attributes,
StrictModeFlag strict_mode,
@@ -2097,10 +2095,10 @@ class JSObject: public JSReceiver {
MUST_USE_RESULT MaybeObject* NormalizeElements();
static void UpdateMapCodeCache(Handle<JSObject> object,
- Handle<String> name,
+ Handle<Name> name,
Handle<Code> code);
- MUST_USE_RESULT MaybeObject* UpdateMapCodeCache(String* name, Code* code);
+ MUST_USE_RESULT MaybeObject* UpdateMapCodeCache(Name* name, Code* code);
// Transform slow named properties to fast variants.
// Returns failure if allocation failed.
@@ -2237,7 +2235,7 @@ class JSObject: public JSReceiver {
// Enqueue change record for Object.observe. May cause GC.
static void EnqueueChangeRecord(Handle<JSObject> object,
const char* type,
- Handle<String> name,
+ Handle<Name> name,
Handle<Object> old_value);
// Deliver change records to observers. May cause GC.
@@ -2284,15 +2282,15 @@ class JSObject: public JSReceiver {
// read-only, reject and set '*done' to true. Otherwise, set '*done' to
// false. Can cause GC and can return a failure result with '*done==true'.
MUST_USE_RESULT MaybeObject* SetPropertyViaPrototypes(
- String* name,
+ Name* name,
Object* value,
PropertyAttributes attributes,
StrictModeFlag strict_mode,
bool* done);
- MUST_USE_RESULT MaybeObject* DeletePropertyPostInterceptor(String* name,
+ MUST_USE_RESULT MaybeObject* DeletePropertyPostInterceptor(Name* name,
DeleteMode mode);
- MUST_USE_RESULT MaybeObject* DeletePropertyWithInterceptor(String* name);
+ MUST_USE_RESULT MaybeObject* DeletePropertyWithInterceptor(Name* name);
MUST_USE_RESULT MaybeObject* DeleteElementWithInterceptor(uint32_t index);
@@ -2310,13 +2308,13 @@ class JSObject: public JSReceiver {
// Gets the current elements capacity and the number of used elements.
void GetElementsCapacityAndUsage(int* capacity, int* used);
- bool CanSetCallback(String* name);
+ bool CanSetCallback(Name* name);
MUST_USE_RESULT MaybeObject* SetElementCallback(
uint32_t index,
Object* structure,
PropertyAttributes attributes);
MUST_USE_RESULT MaybeObject* SetPropertyCallback(
- String* name,
+ Name* name,
Object* structure,
PropertyAttributes attributes);
MUST_USE_RESULT MaybeObject* DefineElementAccessor(
@@ -2324,9 +2322,9 @@ class JSObject: public JSReceiver {
Object* getter,
Object* setter,
PropertyAttributes attributes);
- MUST_USE_RESULT MaybeObject* CreateAccessorPairFor(String* name);
+ MUST_USE_RESULT MaybeObject* CreateAccessorPairFor(Name* name);
MUST_USE_RESULT MaybeObject* DefinePropertyAccessor(
- String* name,
+ Name* name,
Object* getter,
Object* setter,
PropertyAttributes attributes);
@@ -2627,7 +2625,7 @@ class DescriptorArray: public FixedArray {
Object* new_index_cache);
// Accessors for fetching instance descriptor at descriptor number.
- inline String* GetKey(int descriptor_number);
+ inline Name* GetKey(int descriptor_number);
inline Object** GetKeySlot(int descriptor_number);
inline Object* GetValue(int descriptor_number);
inline Object** GetValueSlot(int descriptor_number);
@@ -2640,7 +2638,7 @@ class DescriptorArray: public FixedArray {
inline Object* GetCallbacksObject(int descriptor_number);
inline AccessorDescriptor* GetCallbacks(int descriptor_number);
- inline String* GetSortedKey(int descriptor_number);
+ inline Name* GetSortedKey(int descriptor_number);
inline int GetSortedKeyIndex(int descriptor_number);
inline void SetSortedKey(int pointer, int descriptor_number);
@@ -2670,11 +2668,11 @@ class DescriptorArray: public FixedArray {
void Sort();
// Search the instance descriptors for given name.
- INLINE(int Search(String* name, int number_of_own_descriptors));
+ INLINE(int Search(Name* name, int number_of_own_descriptors));
// As the above, but uses DescriptorLookupCache and updates it when
// necessary.
- INLINE(int SearchWithCache(String* name, Map* map));
+ INLINE(int SearchWithCache(Name* name, Map* map));
// Allocates a DescriptorArray, but returns the singleton
// empty descriptor array object if number_of_descriptors is 0.
@@ -2783,11 +2781,11 @@ class DescriptorArray: public FixedArray {
enum SearchMode { ALL_ENTRIES, VALID_ENTRIES };
template<SearchMode search_mode, typename T>
-inline int LinearSearch(T* array, String* name, int len, int valid_entries);
+inline int LinearSearch(T* array, Name* name, int len, int valid_entries);
template<SearchMode search_mode, typename T>
-inline int Search(T* array, String* name, int valid_entries = 0);
+inline int Search(T* array, Name* name, int valid_entries = 0);
// HashTable is a subclass of FixedArray that implements a hash table
@@ -3115,11 +3113,11 @@ class MapCacheShape : public BaseShape<HashTableKey*> {
// MapCache.
//
-// Maps keys that are a fixed array of internalized strings to a map.
+// Maps keys that are a fixed array of unique names to a map.
// Used for canonicalize maps for object literals.
class MapCache: public HashTable<MapCacheShape, HashTableKey*> {
public:
- // Find cached value for a string key, otherwise return null.
+ // Find cached value for a name key, otherwise return null.
Object* Lookup(FixedArray* key);
MUST_USE_RESULT MaybeObject* Put(FixedArray* key, Map* value);
static inline MapCache* cast(Object* obj);
@@ -3238,29 +3236,29 @@ class Dictionary: public HashTable<Shape, Key> {
};
-class StringDictionaryShape : public BaseShape<String*> {
+class NameDictionaryShape : public BaseShape<Name*> {
public:
- static inline bool IsMatch(String* key, Object* other);
- static inline uint32_t Hash(String* key);
- static inline uint32_t HashForObject(String* key, Object* object);
- MUST_USE_RESULT static inline MaybeObject* AsObject(String* key);
+ static inline bool IsMatch(Name* key, Object* other);
+ static inline uint32_t Hash(Name* key);
+ static inline uint32_t HashForObject(Name* key, Object* object);
+ MUST_USE_RESULT static inline MaybeObject* AsObject(Name* key);
static const int kPrefixSize = 2;
static const int kEntrySize = 3;
static const bool kIsEnumerable = true;
};
-class StringDictionary: public Dictionary<StringDictionaryShape, String*> {
+class NameDictionary: public Dictionary<NameDictionaryShape, Name*> {
public:
- static inline StringDictionary* cast(Object* obj) {
+ static inline NameDictionary* cast(Object* obj) {
ASSERT(obj->IsDictionary());
- return reinterpret_cast<StringDictionary*>(obj);
+ return reinterpret_cast<NameDictionary*>(obj);
}
// Copies enumerable keys to preallocated fixed array.
FixedArray* CopyEnumKeysTo(FixedArray* storage);
static void DoGenerateNewEnumerationIndices(
- Handle<StringDictionary> dictionary);
+ Handle<NameDictionary> dictionary);
// For transforming properties of a JSObject.
MUST_USE_RESULT MaybeObject* TransformPropertiesToFastFor(
@@ -3269,7 +3267,7 @@ class StringDictionary: public Dictionary<StringDictionaryShape, String*> {
// Find entry for key, otherwise return kNotFound. Optimized version of
// HashTable::FindEntry.
- int FindEntry(String* key);
+ int FindEntry(Name* key);
};
@@ -4912,7 +4910,7 @@ class Map: public HeapObject {
Map* transitioned_map);
inline void SetTransition(int transition_index, Map* target);
inline Map* GetTransition(int transition_index);
- MUST_USE_RESULT inline MaybeObject* AddTransition(String* key,
+ MUST_USE_RESULT inline MaybeObject* AddTransition(Name* key,
Map* target,
SimpleTransitionFlag flag);
DECL_ACCESSORS(transitions, TransitionArray)
@@ -5010,11 +5008,11 @@ class Map: public HeapObject {
// with the given holder if the name is found. The holder may be
// NULL when this function is used from the compiler.
inline void LookupDescriptor(JSObject* holder,
- String* name,
+ Name* name,
LookupResult* result);
inline void LookupTransition(JSObject* holder,
- String* name,
+ Name* name,
LookupResult* result);
// The size of transition arrays are limited so they do not end up in large
@@ -5063,7 +5061,7 @@ class Map: public HeapObject {
MUST_USE_RESULT MaybeObject* CopyDropDescriptors();
MUST_USE_RESULT MaybeObject* CopyReplaceDescriptors(
DescriptorArray* descriptors,
- String* name,
+ Name* name,
TransitionFlag flag,
int descriptor_index);
MUST_USE_RESULT MaybeObject* ShareDescriptor(DescriptorArray* descriptors,
@@ -5091,7 +5089,7 @@ class Map: public HeapObject {
MUST_USE_RESULT MaybeObject* Copy();
// Returns the property index for name (only valid for FAST MODE).
- int PropertyIndexFor(String* name);
+ int PropertyIndexFor(Name* name);
// Returns the next free property index (only valid for FAST MODE).
int NextFreePropertyIndex();
@@ -5105,7 +5103,7 @@ class Map: public HeapObject {
static inline Map* cast(Object* obj);
// Locate an accessor in the instance descriptor.
- AccessorDescriptor* FindAccessor(String* name);
+ AccessorDescriptor* FindAccessor(Name* name);
// Code cache operations.
@@ -5114,9 +5112,9 @@ class Map: public HeapObject {
// Update code cache.
static void UpdateCodeCache(Handle<Map> map,
- Handle<String> name,
+ Handle<Name> name,
Handle<Code> code);
- MUST_USE_RESULT MaybeObject* UpdateCodeCache(String* name, Code* code);
+ MUST_USE_RESULT MaybeObject* UpdateCodeCache(Name* name, Code* code);
// Extend the descriptor array of the map with the list of descriptors.
// In case of duplicates, the latest descriptor is used.
@@ -5126,14 +5124,14 @@ class Map: public HeapObject {
static void EnsureDescriptorSlack(Handle<Map> map, int slack);
// Returns the found code or undefined if absent.
- Object* FindInCodeCache(String* name, Code::Flags flags);
+ Object* FindInCodeCache(Name* name, Code::Flags flags);
// Returns the non-negative index of the code object if it is in the
// cache and -1 otherwise.
int IndexInCodeCache(Object* name, Code* code);
// Removes a code object from the code cache at the given index.
- void RemoveFromCodeCache(String* name, Code* code, int index);
+ void RemoveFromCodeCache(Name* name, Code* code, int index);
// Set all map transitions from this map to dead maps to null. Also clear
// back pointers in transition targets so that we do not process this map
@@ -6344,7 +6342,7 @@ class GlobalObject: public JSObject {
// by throwing an exception. This is for the debug and builtins global
// objects, where it is known which properties can be expected to be present
// on the object.
- Object* GetPropertyNoExceptionThrown(String* key) {
+ Object* GetPropertyNoExceptionThrown(Name* key) {
Object* answer = GetProperty(key)->ToObjectUnchecked();
return answer;
}
@@ -6352,10 +6350,10 @@ class GlobalObject: public JSObject {
// Ensure that the global object has a cell for the given property name.
static Handle<JSGlobalPropertyCell> EnsurePropertyCell(
Handle<GlobalObject> global,
- Handle<String> name);
+ Handle<Name> name);
// TODO(kmillikin): This function can be eliminated once the stub cache is
// fully handlified (and the static helper can be written directly).
- MUST_USE_RESULT MaybeObject* EnsurePropertyCell(String* name);
+ MUST_USE_RESULT MaybeObject* EnsurePropertyCell(Name* name);
// Casting.
static inline GlobalObject* cast(Object* obj);
@@ -6806,11 +6804,11 @@ class CodeCache: public Struct {
DECL_ACCESSORS(normal_type_cache, Object)
// Add the code object to the cache.
- MUST_USE_RESULT MaybeObject* Update(String* name, Code* code);
+ MUST_USE_RESULT MaybeObject* Update(Name* name, Code* code);
// Lookup code object in the cache. Returns code object if found and undefined
// if not.
- Object* Lookup(String* name, Code::Flags flags);
+ Object* Lookup(Name* name, Code::Flags flags);
// Get the internal index of a code object in the cache. Returns -1 if the
// code object is not in that cache. This index can be used to later call
@@ -6833,10 +6831,10 @@ class CodeCache: public Struct {
static const int kSize = kNormalTypeCacheOffset + kPointerSize;
private:
- MUST_USE_RESULT MaybeObject* UpdateDefaultCache(String* name, Code* code);
- MUST_USE_RESULT MaybeObject* UpdateNormalTypeCache(String* name, Code* code);
- Object* LookupDefaultCache(String* name, Code::Flags flags);
- Object* LookupNormalTypeCache(String* name, Code::Flags flags);
+ MUST_USE_RESULT MaybeObject* UpdateDefaultCache(Name* name, Code* code);
+ MUST_USE_RESULT MaybeObject* UpdateNormalTypeCache(Name* name, Code* code);
+ Object* LookupDefaultCache(Name* name, Code::Flags flags);
+ Object* LookupNormalTypeCache(Name* name, Code::Flags flags);
// Code cache layout of the default cache. Elements are alternating name and
// code objects for non normal load/store/call IC's.
@@ -6874,10 +6872,10 @@ class CodeCacheHashTableShape : public BaseShape<HashTableKey*> {
class CodeCacheHashTable: public HashTable<CodeCacheHashTableShape,
HashTableKey*> {
public:
- Object* Lookup(String* name, Code::Flags flags);
- MUST_USE_RESULT MaybeObject* Put(String* name, Code* code);
+ Object* Lookup(Name* name, Code::Flags flags);
+ MUST_USE_RESULT MaybeObject* Put(Name* name, Code* code);
- int GetIndex(String* name, Code::Flags flags);
+ int GetIndex(Name* name, Code::Flags flags);
void RemoveByIndex(int index);
static inline CodeCacheHashTable* cast(Object* obj);
@@ -7162,9 +7160,17 @@ class Name: public HeapObject {
// Returns a hash value used for the property table
inline uint32_t Hash();
+ // Equality operations.
+ inline bool Equals(Name* other);
+
+ // Conversion.
+ inline bool AsArrayIndex(uint32_t* index);
+
// Casting.
static inline Name* cast(Object* obj);
+ DECLARE_PRINTER(Name)
+
// Layout description.
static const int kHashFieldOffset = HeapObject::kHeaderSize;
static const int kSize = kHashFieldOffset + kPointerSize;
@@ -8085,19 +8091,19 @@ class JSProxy: public JSReceiver {
// Casting.
static inline JSProxy* cast(Object* obj);
- bool HasPropertyWithHandler(String* name);
+ bool HasPropertyWithHandler(Name* name);
bool HasElementWithHandler(uint32_t index);
MUST_USE_RESULT MaybeObject* GetPropertyWithHandler(
Object* receiver,
- String* name);
+ Name* name);
MUST_USE_RESULT MaybeObject* GetElementWithHandler(
Object* receiver,
uint32_t index);
MUST_USE_RESULT MaybeObject* SetPropertyWithHandler(
JSReceiver* receiver,
- String* name,
+ Name* name,
Object* value,
PropertyAttributes attributes,
StrictModeFlag strict_mode);
@@ -8113,14 +8119,14 @@ class JSProxy: public JSReceiver {
// otherwise set it to false.
MUST_USE_RESULT MaybeObject* SetPropertyViaPrototypesWithHandler(
JSReceiver* receiver,
- String* name,
+ Name* name,
Object* value,
PropertyAttributes attributes,
StrictModeFlag strict_mode,
bool* done);
MUST_USE_RESULT MaybeObject* DeletePropertyWithHandler(
- String* name,
+ Name* name,
DeleteMode mode);
MUST_USE_RESULT MaybeObject* DeleteElementWithHandler(
uint32_t index,
@@ -8128,7 +8134,7 @@ class JSProxy: public JSReceiver {
MUST_USE_RESULT PropertyAttributes GetPropertyAttributeWithHandler(
JSReceiver* receiver,
- String* name);
+ Name* name);
MUST_USE_RESULT PropertyAttributes GetElementAttributeWithHandler(
JSReceiver* receiver,
uint32_t index);
« no previous file with comments | « src/log.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698