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

Side by Side Diff: src/objects.h

Issue 151019: Changed the global object representation (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 } 146 }
147 147
148 bool IsProperty() { 148 bool IsProperty() {
149 return type() < FIRST_PHANTOM_PROPERTY_TYPE; 149 return type() < FIRST_PHANTOM_PROPERTY_TYPE;
150 } 150 }
151 151
152 PropertyAttributes attributes() { return AttributesField::decode(value_); } 152 PropertyAttributes attributes() { return AttributesField::decode(value_); }
153 153
154 int index() { return IndexField::decode(value_); } 154 int index() { return IndexField::decode(value_); }
155 155
156 inline PropertyDetails AsDeleted();
157
156 static bool IsValidIndex(int index) { return IndexField::is_valid(index); } 158 static bool IsValidIndex(int index) { return IndexField::is_valid(index); }
157 159
158 bool IsReadOnly() { return (attributes() & READ_ONLY) != 0; } 160 bool IsReadOnly() { return (attributes() & READ_ONLY) != 0; }
159 bool IsDontDelete() { return (attributes() & DONT_DELETE) != 0; } 161 bool IsDontDelete() { return (attributes() & DONT_DELETE) != 0; }
160 bool IsDontEnum() { return (attributes() & DONT_ENUM) != 0; } 162 bool IsDontEnum() { return (attributes() & DONT_ENUM) != 0; }
163 bool IsDeleted() { return DeletedField::decode(value_) != 0;}
161 164
162 // Bit fields in value_ (type, shift, size). Must be public so the 165 // Bit fields in value_ (type, shift, size). Must be public so the
163 // constants can be embedded in generated code. 166 // constants can be embedded in generated code.
164 class TypeField: public BitField<PropertyType, 0, 3> {}; 167 class TypeField: public BitField<PropertyType, 0, 3> {};
165 class AttributesField: public BitField<PropertyAttributes, 3, 3> {}; 168 class AttributesField: public BitField<PropertyAttributes, 3, 3> {};
166 class IndexField: public BitField<uint32_t, 6, 32-6> {}; 169 class DeletedField: public BitField<uint32_t, 6, 1> {};
170 class IndexField: public BitField<uint32_t, 7, 31-7> {};
167 171
168 static const int kInitialIndex = 1; 172 static const int kInitialIndex = 1;
169
170 private: 173 private:
171 uint32_t value_; 174 uint32_t value_;
172 }; 175 };
173 176
174 177
175 // Setter that skips the write barrier if mode is SKIP_WRITE_BARRIER. 178 // Setter that skips the write barrier if mode is SKIP_WRITE_BARRIER.
176 enum WriteBarrierMode { SKIP_WRITE_BARRIER, UPDATE_WRITE_BARRIER }; 179 enum WriteBarrierMode { SKIP_WRITE_BARRIER, UPDATE_WRITE_BARRIER };
177 180
178 181
179 // PropertyNormalizationMode is used to specify whether to keep 182 // PropertyNormalizationMode is used to specify whether to keep
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 V(LONG_EXTERNAL_STRING_TYPE) \ 259 V(LONG_EXTERNAL_STRING_TYPE) \
257 V(SHORT_EXTERNAL_ASCII_STRING_TYPE) \ 260 V(SHORT_EXTERNAL_ASCII_STRING_TYPE) \
258 V(MEDIUM_EXTERNAL_ASCII_STRING_TYPE) \ 261 V(MEDIUM_EXTERNAL_ASCII_STRING_TYPE) \
259 V(LONG_EXTERNAL_ASCII_STRING_TYPE) \ 262 V(LONG_EXTERNAL_ASCII_STRING_TYPE) \
260 V(LONG_PRIVATE_EXTERNAL_ASCII_STRING_TYPE) \ 263 V(LONG_PRIVATE_EXTERNAL_ASCII_STRING_TYPE) \
261 \ 264 \
262 V(MAP_TYPE) \ 265 V(MAP_TYPE) \
263 V(HEAP_NUMBER_TYPE) \ 266 V(HEAP_NUMBER_TYPE) \
264 V(FIXED_ARRAY_TYPE) \ 267 V(FIXED_ARRAY_TYPE) \
265 V(CODE_TYPE) \ 268 V(CODE_TYPE) \
269 V(JS_GLOBAL_PROPERTY_CELL_TYPE) \
266 V(ODDBALL_TYPE) \ 270 V(ODDBALL_TYPE) \
267 V(PROXY_TYPE) \ 271 V(PROXY_TYPE) \
268 V(BYTE_ARRAY_TYPE) \ 272 V(BYTE_ARRAY_TYPE) \
269 V(FILLER_TYPE) \ 273 V(FILLER_TYPE) \
270 \ 274 \
271 V(ACCESSOR_INFO_TYPE) \ 275 V(ACCESSOR_INFO_TYPE) \
272 V(ACCESS_CHECK_INFO_TYPE) \ 276 V(ACCESS_CHECK_INFO_TYPE) \
273 V(INTERCEPTOR_INFO_TYPE) \ 277 V(INTERCEPTOR_INFO_TYPE) \
274 V(SHARED_FUNCTION_INFO_TYPE) \ 278 V(SHARED_FUNCTION_INFO_TYPE) \
275 V(CALL_HANDLER_INFO_TYPE) \ 279 V(CALL_HANDLER_INFO_TYPE) \
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 kMediumStringTag | kAsciiStringTag | kExternalStringTag, 544 kMediumStringTag | kAsciiStringTag | kExternalStringTag,
541 LONG_EXTERNAL_ASCII_STRING_TYPE = 545 LONG_EXTERNAL_ASCII_STRING_TYPE =
542 kLongStringTag | kAsciiStringTag | kExternalStringTag, 546 kLongStringTag | kAsciiStringTag | kExternalStringTag,
543 LONG_PRIVATE_EXTERNAL_ASCII_STRING_TYPE = LONG_EXTERNAL_ASCII_STRING_TYPE, 547 LONG_PRIVATE_EXTERNAL_ASCII_STRING_TYPE = LONG_EXTERNAL_ASCII_STRING_TYPE,
544 548
545 MAP_TYPE = kNotStringTag, 549 MAP_TYPE = kNotStringTag,
546 HEAP_NUMBER_TYPE, 550 HEAP_NUMBER_TYPE,
547 FIXED_ARRAY_TYPE, 551 FIXED_ARRAY_TYPE,
548 CODE_TYPE, 552 CODE_TYPE,
549 ODDBALL_TYPE, 553 ODDBALL_TYPE,
554 JS_GLOBAL_PROPERTY_CELL_TYPE,
550 PROXY_TYPE, 555 PROXY_TYPE,
551 BYTE_ARRAY_TYPE, 556 BYTE_ARRAY_TYPE,
552 FILLER_TYPE, 557 FILLER_TYPE,
553 SMI_TYPE, 558 SMI_TYPE,
554 559
555 ACCESSOR_INFO_TYPE, 560 ACCESSOR_INFO_TYPE,
556 ACCESS_CHECK_INFO_TYPE, 561 ACCESS_CHECK_INFO_TYPE,
557 INTERCEPTOR_INFO_TYPE, 562 INTERCEPTOR_INFO_TYPE,
558 SHARED_FUNCTION_INFO_TYPE, 563 SHARED_FUNCTION_INFO_TYPE,
559 CALL_HANDLER_INFO_TYPE, 564 CALL_HANDLER_INFO_TYPE,
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 inline bool IsSymbolTable(); 682 inline bool IsSymbolTable();
678 inline bool IsCompilationCacheTable(); 683 inline bool IsCompilationCacheTable();
679 inline bool IsMapCache(); 684 inline bool IsMapCache();
680 inline bool IsPrimitive(); 685 inline bool IsPrimitive();
681 inline bool IsGlobalObject(); 686 inline bool IsGlobalObject();
682 inline bool IsJSGlobalObject(); 687 inline bool IsJSGlobalObject();
683 inline bool IsJSBuiltinsObject(); 688 inline bool IsJSBuiltinsObject();
684 inline bool IsJSGlobalProxy(); 689 inline bool IsJSGlobalProxy();
685 inline bool IsUndetectableObject(); 690 inline bool IsUndetectableObject();
686 inline bool IsAccessCheckNeeded(); 691 inline bool IsAccessCheckNeeded();
692 inline bool IsJSGlobalPropertyCell();
687 693
688 // Returns true if this object is an instance of the specified 694 // Returns true if this object is an instance of the specified
689 // function template. 695 // function template.
690 bool IsInstanceOf(FunctionTemplateInfo* type); 696 bool IsInstanceOf(FunctionTemplateInfo* type);
691 697
692 inline bool IsStruct(); 698 inline bool IsStruct();
693 #define DECLARE_STRUCT_PREDICATE(NAME, Name, name) inline bool Is##Name(); 699 #define DECLARE_STRUCT_PREDICATE(NAME, Name, name) inline bool Is##Name();
694 STRUCT_LIST(DECLARE_STRUCT_PREDICATE) 700 STRUCT_LIST(DECLARE_STRUCT_PREDICATE)
695 #undef DECLARE_STRUCT_PREDICATE 701 #undef DECLARE_STRUCT_PREDICATE
696 702
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
1186 DISALLOW_IMPLICIT_CONSTRUCTORS(HeapNumber); 1192 DISALLOW_IMPLICIT_CONSTRUCTORS(HeapNumber);
1187 }; 1193 };
1188 1194
1189 1195
1190 // The JSObject describes real heap allocated JavaScript objects with 1196 // The JSObject describes real heap allocated JavaScript objects with
1191 // properties. 1197 // properties.
1192 // Note that the map of JSObject changes during execution to enable inline 1198 // Note that the map of JSObject changes during execution to enable inline
1193 // caching. 1199 // caching.
1194 class JSObject: public HeapObject { 1200 class JSObject: public HeapObject {
1195 public: 1201 public:
1202 enum DeleteMode { NORMAL_DELETION, FORCE_DELETION };
1203
1196 // [properties]: Backing storage for properties. 1204 // [properties]: Backing storage for properties.
1197 // properties is a FixedArray in the fast case, and a Dictionary in the 1205 // properties is a FixedArray in the fast case, and a Dictionary in the
1198 // slow case. 1206 // slow case.
1199 DECL_ACCESSORS(properties, FixedArray) // Get and set fast properties. 1207 DECL_ACCESSORS(properties, FixedArray) // Get and set fast properties.
1200 inline void initialize_properties(); 1208 inline void initialize_properties();
1201 inline bool HasFastProperties(); 1209 inline bool HasFastProperties();
1202 inline Dictionary* property_dictionary(); // Gets slow properties. 1210 inline Dictionary* property_dictionary(); // Gets slow properties.
1203 1211
1204 // [elements]: The elements (properties with names that are integers). 1212 // [elements]: The elements (properties with names that are integers).
1205 // elements is a FixedArray in the fast case, and a Dictionary in the slow 1213 // elements is a FixedArray in the fast case, and a Dictionary in the slow
(...skipping 30 matching lines...) Expand all
1236 Object* SetPropertyWithInterceptor(String* name, 1244 Object* SetPropertyWithInterceptor(String* name,
1237 Object* value, 1245 Object* value,
1238 PropertyAttributes attributes); 1246 PropertyAttributes attributes);
1239 Object* SetPropertyPostInterceptor(String* name, 1247 Object* SetPropertyPostInterceptor(String* name,
1240 Object* value, 1248 Object* value,
1241 PropertyAttributes attributes); 1249 PropertyAttributes attributes);
1242 Object* IgnoreAttributesAndSetLocalProperty(String* key, 1250 Object* IgnoreAttributesAndSetLocalProperty(String* key,
1243 Object* value, 1251 Object* value,
1244 PropertyAttributes attributes); 1252 PropertyAttributes attributes);
1245 1253
1254 // Retrieve a value in a normalized object given a lookup result.
1255 // Handles the special representation of JS global objects.
1256 Object* GetNormalizedProperty(LookupResult* result);
1257
1258 // Sets the property value in a normalized object given a lookup result.
1259 // Handles the special representation of JS global objects.
1260 Object* SetNormalizedProperty(LookupResult* result, Object* value);
1261
1262 // Sets the property value in a normalized object given (key, value, details).
1263 // Handles the special representation of JS global objects.
1264 Object* SetNormalizedProperty(String* name,
1265 Object* value,
1266 PropertyDetails details);
1267
1268 // Deletes the named property in a normalized object.
1269 Object* DeleteNormalizedProperty(String* name, DeleteMode mode);
1270
1246 // Sets a property that currently has lazy loading. 1271 // Sets a property that currently has lazy loading.
1247 Object* SetLazyProperty(LookupResult* result, 1272 Object* SetLazyProperty(LookupResult* result,
1248 String* name, 1273 String* name,
1249 Object* value, 1274 Object* value,
1250 PropertyAttributes attributes); 1275 PropertyAttributes attributes);
1251 1276
1252 // Returns the class name ([[Class]] property in the specification). 1277 // Returns the class name ([[Class]] property in the specification).
1253 String* class_name(); 1278 String* class_name();
1254 1279
1255 // Retrieve interceptors. 1280 // Retrieve interceptors.
(...skipping 30 matching lines...) Expand all
1286 1311
1287 bool HasProperty(String* name) { 1312 bool HasProperty(String* name) {
1288 return GetPropertyAttribute(name) != ABSENT; 1313 return GetPropertyAttribute(name) != ABSENT;
1289 } 1314 }
1290 1315
1291 // Can cause a GC if it hits an interceptor. 1316 // Can cause a GC if it hits an interceptor.
1292 bool HasLocalProperty(String* name) { 1317 bool HasLocalProperty(String* name) {
1293 return GetLocalPropertyAttribute(name) != ABSENT; 1318 return GetLocalPropertyAttribute(name) != ABSENT;
1294 } 1319 }
1295 1320
1296 enum DeleteMode { NORMAL_DELETION, FORCE_DELETION };
1297 Object* DeleteProperty(String* name, DeleteMode mode); 1321 Object* DeleteProperty(String* name, DeleteMode mode);
1298 Object* DeleteElement(uint32_t index, DeleteMode mode); 1322 Object* DeleteElement(uint32_t index, DeleteMode mode);
1299 Object* DeleteLazyProperty(LookupResult* result, 1323 Object* DeleteLazyProperty(LookupResult* result,
1300 String* name, 1324 String* name,
1301 DeleteMode mode); 1325 DeleteMode mode);
1302 1326
1303 // Tests for the fast common case for property enumeration. 1327 // Tests for the fast common case for property enumeration.
1304 bool IsSimpleEnum(); 1328 bool IsSimpleEnum();
1305 1329
1306 // Do we want to keep the elements in fast case when increasing the 1330 // Do we want to keep the elements in fast case when increasing the
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
1923 } 1947 }
1924 1948
1925 static const int kNumberOfElementsIndex = 0; 1949 static const int kNumberOfElementsIndex = 0;
1926 static const int kCapacityIndex = 1; 1950 static const int kCapacityIndex = 1;
1927 static const int kPrefixStartIndex = 2; 1951 static const int kPrefixStartIndex = 2;
1928 static const int kElementsStartIndex = kPrefixStartIndex + prefix_size; 1952 static const int kElementsStartIndex = kPrefixStartIndex + prefix_size;
1929 static const int kElementSize = element_size; 1953 static const int kElementSize = element_size;
1930 static const int kElementsStartOffset = 1954 static const int kElementsStartOffset =
1931 kHeaderSize + kElementsStartIndex * kPointerSize; 1955 kHeaderSize + kElementsStartIndex * kPointerSize;
1932 1956
1957 // Constant used for denoting a absent entry.
1958 static const int kNotFound = -1;
1959
1933 protected: 1960 protected:
1934 // Find entry for key otherwise return -1. 1961 // Find entry for key otherwise return -1.
1935 int FindEntry(HashTableKey* key); 1962 int FindEntry(HashTableKey* key);
1936 1963
1937 // Find the entry at which to insert element with the given key that 1964 // Find the entry at which to insert element with the given key that
1938 // has the given hash value. 1965 // has the given hash value.
1939 uint32_t FindInsertionEntry(Object* key, uint32_t hash); 1966 uint32_t FindInsertionEntry(Object* key, uint32_t hash);
1940 1967
1941 // Returns the index for an entry (of the key) 1968 // Returns the index for an entry (of the key)
1942 static inline int EntryToIndex(int entry) { 1969 static inline int EntryToIndex(int entry) {
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
2020 // 2047 //
2021 // The rest of the array embeds triples of (key, value, details). 2048 // The rest of the array embeds triples of (key, value, details).
2022 // if key == undefined the triple is empty. 2049 // if key == undefined the triple is empty.
2023 // if key == null the triple has been deleted. 2050 // if key == null the triple has been deleted.
2024 // otherwise key contains the name of a property. 2051 // otherwise key contains the name of a property.
2025 class DictionaryBase: public HashTable<2, 3> {}; 2052 class DictionaryBase: public HashTable<2, 3> {};
2026 2053
2027 class Dictionary: public DictionaryBase { 2054 class Dictionary: public DictionaryBase {
2028 public: 2055 public:
2029 // Returns the value at entry. 2056 // Returns the value at entry.
2030 Object* ValueAt(int entry) { return get(EntryToIndex(entry)+1); } 2057 Object* ValueAt(int entry) {
2058 return get(EntryToIndex(entry)+1);
2059 }
2031 2060
2032 // Set the value for entry. 2061 // Set the value for entry.
2033 void ValueAtPut(int entry, Object* value) { 2062 void ValueAtPut(int entry, Object* value) {
2034 set(EntryToIndex(entry)+1, value); 2063 set(EntryToIndex(entry)+1, value);
2035 } 2064 }
2036 2065
2037 // Returns the property details for the property at entry. 2066 // Returns the property details for the property at entry.
2038 PropertyDetails DetailsAt(int entry) { 2067 PropertyDetails DetailsAt(int entry) {
2039 ASSERT(entry >= 0); // Not found is -1, which is not caught by get(). 2068 ASSERT(entry >= 0); // Not found is -1, which is not caught by get().
2040 return PropertyDetails(Smi::cast(get(EntryToIndex(entry) + 2))); 2069 return PropertyDetails(Smi::cast(get(EntryToIndex(entry) + 2)));
(...skipping 16 matching lines...) Expand all
2057 // Find entry for string key otherwise return -1. 2086 // Find entry for string key otherwise return -1.
2058 int FindStringEntry(String* key); 2087 int FindStringEntry(String* key);
2059 2088
2060 // Find entry for number key otherwise return -1. 2089 // Find entry for number key otherwise return -1.
2061 int FindNumberEntry(uint32_t index); 2090 int FindNumberEntry(uint32_t index);
2062 2091
2063 // Delete a property from the dictionary. 2092 // Delete a property from the dictionary.
2064 Object* DeleteProperty(int entry, JSObject::DeleteMode mode); 2093 Object* DeleteProperty(int entry, JSObject::DeleteMode mode);
2065 2094
2066 // Type specific at put (default NONE attributes is used when adding). 2095 // Type specific at put (default NONE attributes is used when adding).
2067 Object* AtStringPut(String* key, Object* value);
2068 Object* AtNumberPut(uint32_t key, Object* value); 2096 Object* AtNumberPut(uint32_t key, Object* value);
2069 2097
2070 Object* AddStringEntry(String* key, Object* value, PropertyDetails details); 2098 Object* AddStringEntry(String* key, Object* value, PropertyDetails details);
2071 Object* AddNumberEntry(uint32_t key, Object* value, PropertyDetails details); 2099 Object* AddNumberEntry(uint32_t key, Object* value, PropertyDetails details);
2072 2100
2073 // Set an existing entry or add a new one if needed. 2101 // Set an existing entry or add a new one if needed.
2074 Object* SetOrAddStringEntry(String* key, 2102 Object* SetStringEntry(int entry,
2075 Object* value, 2103 String* key,
2076 PropertyDetails details); 2104 Object* value,
2105 PropertyDetails details);
2077 2106
2078 Object* SetOrAddNumberEntry(uint32_t key, 2107 Object* SetOrAddNumberEntry(uint32_t key,
2079 Object* value, 2108 Object* value,
2080 PropertyDetails details); 2109 PropertyDetails details);
2081 2110
2082 // Returns the number of elements in the dictionary filtering out properties 2111 // Returns the number of elements in the dictionary filtering out properties
2083 // with the specified attributes. 2112 // with the specified attributes.
2084 int NumberOfElementsFilterAttributes(PropertyAttributes filter); 2113 int NumberOfElementsFilterAttributes(PropertyAttributes filter);
2085 2114
2086 // Returns the number of enumerable elements in the dictionary. 2115 // Returns the number of enumerable elements in the dictionary.
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
2245 // objects or relative instruction addresses. 2274 // objects or relative instruction addresses.
2246 enum ICTargetState { 2275 enum ICTargetState {
2247 IC_TARGET_IS_ADDRESS, 2276 IC_TARGET_IS_ADDRESS,
2248 IC_TARGET_IS_OBJECT 2277 IC_TARGET_IS_OBJECT
2249 }; 2278 };
2250 2279
2251 #ifdef ENABLE_DISASSEMBLER 2280 #ifdef ENABLE_DISASSEMBLER
2252 // Printing 2281 // Printing
2253 static const char* Kind2String(Kind kind); 2282 static const char* Kind2String(Kind kind);
2254 static const char* ICState2String(InlineCacheState state); 2283 static const char* ICState2String(InlineCacheState state);
2284 static const char* PropertyType2String(PropertyType type);
2255 void Disassemble(const char* name); 2285 void Disassemble(const char* name);
2256 #endif // ENABLE_DISASSEMBLER 2286 #endif // ENABLE_DISASSEMBLER
2257 2287
2258 // [instruction_size]: Size of the native instructions 2288 // [instruction_size]: Size of the native instructions
2259 inline int instruction_size(); 2289 inline int instruction_size();
2260 inline void set_instruction_size(int value); 2290 inline void set_instruction_size(int value);
2261 2291
2262 // [relocation_size]: Size of relocation information. 2292 // [relocation_size]: Size of relocation information.
2263 inline int relocation_size(); 2293 inline int relocation_size();
2264 inline void set_relocation_size(int value); 2294 inline void set_relocation_size(int value);
2265 2295
2266 // [sinfo_size]: Size of scope information. 2296 // [sinfo_size]: Size of scope information.
2267 inline int sinfo_size(); 2297 inline int sinfo_size();
2268 inline void set_sinfo_size(int value); 2298 inline void set_sinfo_size(int value);
2269 2299
2270 // [flags]: Various code flags. 2300 // [flags]: Various code flags.
2271 inline Flags flags(); 2301 inline Flags flags();
2272 inline void set_flags(Flags flags); 2302 inline void set_flags(Flags flags);
2273 2303
2274 // [flags]: Access to specific code flags. 2304 // [flags]: Access to specific code flags.
2275 inline Kind kind(); 2305 inline Kind kind();
2276 inline InlineCacheState ic_state(); // Only valid for IC stubs. 2306 inline InlineCacheState ic_state(); // Only valid for IC stubs.
2277 inline InLoopFlag ic_in_loop(); // Only valid for IC stubs.. 2307 inline InLoopFlag ic_in_loop(); // Only valid for IC stubs.
2278 inline PropertyType type(); // Only valid for monomorphic IC stubs. 2308 inline PropertyType type(); // Only valid for monomorphic IC stubs.
2279 inline int arguments_count(); // Only valid for call IC stubs. 2309 inline int arguments_count(); // Only valid for call IC stubs.
2280 2310
2281 // Testers for IC stub kinds. 2311 // Testers for IC stub kinds.
2282 inline bool is_inline_cache_stub(); 2312 inline bool is_inline_cache_stub();
2283 inline bool is_load_stub() { return kind() == LOAD_IC; } 2313 inline bool is_load_stub() { return kind() == LOAD_IC; }
2284 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; } 2314 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; }
2285 inline bool is_store_stub() { return kind() == STORE_IC; } 2315 inline bool is_store_stub() { return kind() == STORE_IC; }
2286 inline bool is_keyed_store_stub() { return kind() == KEYED_STORE_IC; } 2316 inline bool is_keyed_store_stub() { return kind() == KEYED_STORE_IC; }
2287 inline bool is_call_stub() { return kind() == CALL_IC; } 2317 inline bool is_call_stub() { return kind() == CALL_IC; }
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
3041 private: 3071 private:
3042 friend class AGCCVersionRequiresThisClassToHaveAFriendSoHereItIs; 3072 friend class AGCCVersionRequiresThisClassToHaveAFriendSoHereItIs;
3043 3073
3044 DISALLOW_IMPLICIT_CONSTRUCTORS(GlobalObject); 3074 DISALLOW_IMPLICIT_CONSTRUCTORS(GlobalObject);
3045 }; 3075 };
3046 3076
3047 3077
3048 // JavaScript global object. 3078 // JavaScript global object.
3049 class JSGlobalObject: public GlobalObject { 3079 class JSGlobalObject: public GlobalObject {
3050 public: 3080 public:
3081
3082 // Retrieve the property cell used to store a property.
3083 Object* GetPropertyCell(LookupResult* result);
3084
3051 // Casting. 3085 // Casting.
3052 static inline JSGlobalObject* cast(Object* obj); 3086 static inline JSGlobalObject* cast(Object* obj);
3053 3087
3054 // Dispatched behavior. 3088 // Dispatched behavior.
3055 #ifdef DEBUG 3089 #ifdef DEBUG
3056 void JSGlobalObjectPrint(); 3090 void JSGlobalObjectPrint();
3057 void JSGlobalObjectVerify(); 3091 void JSGlobalObjectVerify();
3058 #endif 3092 #endif
3059 3093
3060 // Layout description. 3094 // Layout description.
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after
3929 // Layout description. 3963 // Layout description.
3930 static const int kToStringOffset = HeapObject::kHeaderSize; 3964 static const int kToStringOffset = HeapObject::kHeaderSize;
3931 static const int kToNumberOffset = kToStringOffset + kPointerSize; 3965 static const int kToNumberOffset = kToStringOffset + kPointerSize;
3932 static const int kSize = kToNumberOffset + kPointerSize; 3966 static const int kSize = kToNumberOffset + kPointerSize;
3933 3967
3934 private: 3968 private:
3935 DISALLOW_IMPLICIT_CONSTRUCTORS(Oddball); 3969 DISALLOW_IMPLICIT_CONSTRUCTORS(Oddball);
3936 }; 3970 };
3937 3971
3938 3972
3973 class JSGlobalPropertyCell: public HeapObject {
3974 public:
3975 // [value]: value of the global property.
3976 DECL_ACCESSORS(value, Object)
3977
3978 // Casting.
3979 static inline JSGlobalPropertyCell* cast(Object* obj);
3980
3981 // Dispatched behavior.
3982 void JSGlobalPropertyCellIterateBody(ObjectVisitor* v);
3983 #ifdef DEBUG
3984 void JSGlobalPropertyCellVerify();
3985 void JSGlobalPropertyCellPrint();
3986 #endif
3987
3988 // Layout description.
3989 static const int kValueOffset = HeapObject::kHeaderSize;
3990 static const int kSize = kValueOffset + kPointerSize;
3991
3992 private:
3993 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalPropertyCell);
3994 };
3995
3996
3997
3939 // Proxy describes objects pointing from JavaScript to C structures. 3998 // Proxy describes objects pointing from JavaScript to C structures.
3940 // Since they cannot contain references to JS HeapObjects they can be 3999 // Since they cannot contain references to JS HeapObjects they can be
3941 // placed in old_data_space. 4000 // placed in old_data_space.
3942 class Proxy: public HeapObject { 4001 class Proxy: public HeapObject {
3943 public: 4002 public:
3944 // [proxy]: field containing the address. 4003 // [proxy]: field containing the address.
3945 inline Address proxy(); 4004 inline Address proxy();
3946 inline void set_proxy(Address value); 4005 inline void set_proxy(Address value);
3947 4006
3948 // Casting. 4007 // Casting.
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
4456 } else { 4515 } else {
4457 value &= ~(1 << bit_position); 4516 value &= ~(1 << bit_position);
4458 } 4517 }
4459 return value; 4518 return value;
4460 } 4519 }
4461 }; 4520 };
4462 4521
4463 } } // namespace v8::internal 4522 } } // namespace v8::internal
4464 4523
4465 #endif // V8_OBJECTS_H_ 4524 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/ic.cc ('k') | src/objects.cc » ('j') | test/cctest/test-api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698