| OLD | NEW |
| 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 1195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1206 | 1206 |
| 1207 // Sets the property value in a normalized object given (key, value, details). | 1207 // Sets the property value in a normalized object given (key, value, details). |
| 1208 // Handles the special representation of JS global objects. | 1208 // Handles the special representation of JS global objects. |
| 1209 Object* SetNormalizedProperty(String* name, | 1209 Object* SetNormalizedProperty(String* name, |
| 1210 Object* value, | 1210 Object* value, |
| 1211 PropertyDetails details); | 1211 PropertyDetails details); |
| 1212 | 1212 |
| 1213 // Deletes the named property in a normalized object. | 1213 // Deletes the named property in a normalized object. |
| 1214 Object* DeleteNormalizedProperty(String* name, DeleteMode mode); | 1214 Object* DeleteNormalizedProperty(String* name, DeleteMode mode); |
| 1215 | 1215 |
| 1216 // Sets a property that currently has lazy loading. | |
| 1217 Object* SetLazyProperty(LookupResult* result, | |
| 1218 String* name, | |
| 1219 Object* value, | |
| 1220 PropertyAttributes attributes); | |
| 1221 | |
| 1222 // Returns the class name ([[Class]] property in the specification). | 1216 // Returns the class name ([[Class]] property in the specification). |
| 1223 String* class_name(); | 1217 String* class_name(); |
| 1224 | 1218 |
| 1225 // Returns the constructor name (the name (possibly, inferred name) of the | 1219 // Returns the constructor name (the name (possibly, inferred name) of the |
| 1226 // function that was used to instantiate the object). | 1220 // function that was used to instantiate the object). |
| 1227 String* constructor_name(); | 1221 String* constructor_name(); |
| 1228 | 1222 |
| 1229 // Retrieve interceptors. | 1223 // Retrieve interceptors. |
| 1230 InterceptorInfo* GetNamedInterceptor(); | 1224 InterceptorInfo* GetNamedInterceptor(); |
| 1231 InterceptorInfo* GetIndexedInterceptor(); | 1225 InterceptorInfo* GetIndexedInterceptor(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1246 PropertyAttributes* attributes); | 1240 PropertyAttributes* attributes); |
| 1247 Object* GetPropertyWithInterceptor(JSObject* receiver, | 1241 Object* GetPropertyWithInterceptor(JSObject* receiver, |
| 1248 String* name, | 1242 String* name, |
| 1249 PropertyAttributes* attributes); | 1243 PropertyAttributes* attributes); |
| 1250 Object* GetPropertyPostInterceptor(JSObject* receiver, | 1244 Object* GetPropertyPostInterceptor(JSObject* receiver, |
| 1251 String* name, | 1245 String* name, |
| 1252 PropertyAttributes* attributes); | 1246 PropertyAttributes* attributes); |
| 1253 Object* GetLocalPropertyPostInterceptor(JSObject* receiver, | 1247 Object* GetLocalPropertyPostInterceptor(JSObject* receiver, |
| 1254 String* name, | 1248 String* name, |
| 1255 PropertyAttributes* attributes); | 1249 PropertyAttributes* attributes); |
| 1256 Object* GetLazyProperty(Object* receiver, | |
| 1257 LookupResult* result, | |
| 1258 String* name, | |
| 1259 PropertyAttributes* attributes); | |
| 1260 | |
| 1261 // Tells whether this object needs to be loaded. | |
| 1262 inline bool IsLoaded(); | |
| 1263 | 1250 |
| 1264 // Returns true if this is an instance of an api function and has | 1251 // Returns true if this is an instance of an api function and has |
| 1265 // been modified since it was created. May give false positives. | 1252 // been modified since it was created. May give false positives. |
| 1266 bool IsDirty(); | 1253 bool IsDirty(); |
| 1267 | 1254 |
| 1268 bool HasProperty(String* name) { | 1255 bool HasProperty(String* name) { |
| 1269 return GetPropertyAttribute(name) != ABSENT; | 1256 return GetPropertyAttribute(name) != ABSENT; |
| 1270 } | 1257 } |
| 1271 | 1258 |
| 1272 // Can cause a GC if it hits an interceptor. | 1259 // Can cause a GC if it hits an interceptor. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1290 // a JSGlobalProxy. Use BypassGlobalProxy method above to get to the real | 1277 // a JSGlobalProxy. Use BypassGlobalProxy method above to get to the real |
| 1291 // holder. | 1278 // holder. |
| 1292 // | 1279 // |
| 1293 // These accessors do not touch interceptors or accessors. | 1280 // These accessors do not touch interceptors or accessors. |
| 1294 inline bool HasHiddenPropertiesObject(); | 1281 inline bool HasHiddenPropertiesObject(); |
| 1295 inline Object* GetHiddenPropertiesObject(); | 1282 inline Object* GetHiddenPropertiesObject(); |
| 1296 inline Object* SetHiddenPropertiesObject(Object* hidden_obj); | 1283 inline Object* SetHiddenPropertiesObject(Object* hidden_obj); |
| 1297 | 1284 |
| 1298 Object* DeleteProperty(String* name, DeleteMode mode); | 1285 Object* DeleteProperty(String* name, DeleteMode mode); |
| 1299 Object* DeleteElement(uint32_t index, DeleteMode mode); | 1286 Object* DeleteElement(uint32_t index, DeleteMode mode); |
| 1300 Object* DeleteLazyProperty(LookupResult* result, | |
| 1301 String* name, | |
| 1302 DeleteMode mode); | |
| 1303 | 1287 |
| 1304 // Tests for the fast common case for property enumeration. | 1288 // Tests for the fast common case for property enumeration. |
| 1305 bool IsSimpleEnum(); | 1289 bool IsSimpleEnum(); |
| 1306 | 1290 |
| 1307 // Do we want to keep the elements in fast case when increasing the | 1291 // Do we want to keep the elements in fast case when increasing the |
| 1308 // capacity? | 1292 // capacity? |
| 1309 bool ShouldConvertToSlowElements(int new_capacity); | 1293 bool ShouldConvertToSlowElements(int new_capacity); |
| 1310 // Returns true if the backing storage for the slow-case elements of | 1294 // Returns true if the backing storage for the slow-case elements of |
| 1311 // this object takes up nearly as much space as a fast-case backing | 1295 // this object takes up nearly as much space as a fast-case backing |
| 1312 // storage would. In that case the JSObject should have fast | 1296 // storage would. In that case the JSObject should have fast |
| (...skipping 1551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2864 // document.all in Firefox & Safari. | 2848 // document.all in Firefox & Safari. |
| 2865 // See https://bugzilla.mozilla.org/show_bug.cgi?id=248549. | 2849 // See https://bugzilla.mozilla.org/show_bug.cgi?id=248549. |
| 2866 inline void set_is_undetectable() { | 2850 inline void set_is_undetectable() { |
| 2867 set_bit_field(bit_field() | (1 << kIsUndetectable)); | 2851 set_bit_field(bit_field() | (1 << kIsUndetectable)); |
| 2868 } | 2852 } |
| 2869 | 2853 |
| 2870 inline bool is_undetectable() { | 2854 inline bool is_undetectable() { |
| 2871 return ((1 << kIsUndetectable) & bit_field()) != 0; | 2855 return ((1 << kIsUndetectable) & bit_field()) != 0; |
| 2872 } | 2856 } |
| 2873 | 2857 |
| 2874 inline void set_needs_loading(bool value) { | |
| 2875 if (value) { | |
| 2876 set_bit_field2(bit_field2() | (1 << kNeedsLoading)); | |
| 2877 } else { | |
| 2878 set_bit_field2(bit_field2() & ~(1 << kNeedsLoading)); | |
| 2879 } | |
| 2880 } | |
| 2881 | |
| 2882 // Does this object or function require a lazily loaded script to be | |
| 2883 // run before being used? | |
| 2884 inline bool needs_loading() { | |
| 2885 return ((1 << kNeedsLoading) & bit_field2()) != 0; | |
| 2886 } | |
| 2887 | |
| 2888 // Tells whether the instance has a call-as-function handler. | 2858 // Tells whether the instance has a call-as-function handler. |
| 2889 inline void set_has_instance_call_handler() { | 2859 inline void set_has_instance_call_handler() { |
| 2890 set_bit_field(bit_field() | (1 << kHasInstanceCallHandler)); | 2860 set_bit_field(bit_field() | (1 << kHasInstanceCallHandler)); |
| 2891 } | 2861 } |
| 2892 | 2862 |
| 2893 inline bool has_instance_call_handler() { | 2863 inline bool has_instance_call_handler() { |
| 2894 return ((1 << kHasInstanceCallHandler) & bit_field()) != 0; | 2864 return ((1 << kHasInstanceCallHandler) & bit_field()) != 0; |
| 2895 } | 2865 } |
| 2896 | 2866 |
| 2897 inline void set_is_extensible() { | 2867 inline void set_is_extensible() { |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3011 static const int kUnused = 0; // To be used for marking recently used maps. | 2981 static const int kUnused = 0; // To be used for marking recently used maps. |
| 3012 static const int kHasNonInstancePrototype = 1; | 2982 static const int kHasNonInstancePrototype = 1; |
| 3013 static const int kIsHiddenPrototype = 2; | 2983 static const int kIsHiddenPrototype = 2; |
| 3014 static const int kHasNamedInterceptor = 3; | 2984 static const int kHasNamedInterceptor = 3; |
| 3015 static const int kHasIndexedInterceptor = 4; | 2985 static const int kHasIndexedInterceptor = 4; |
| 3016 static const int kIsUndetectable = 5; | 2986 static const int kIsUndetectable = 5; |
| 3017 static const int kHasInstanceCallHandler = 6; | 2987 static const int kHasInstanceCallHandler = 6; |
| 3018 static const int kIsAccessCheckNeeded = 7; | 2988 static const int kIsAccessCheckNeeded = 7; |
| 3019 | 2989 |
| 3020 // Bit positions for bit field 2 | 2990 // Bit positions for bit field 2 |
| 3021 static const int kNeedsLoading = 0; | 2991 static const int kIsExtensible = 0; |
| 3022 static const int kIsExtensible = 1; | |
| 3023 | 2992 |
| 3024 private: | 2993 private: |
| 3025 DISALLOW_IMPLICIT_CONSTRUCTORS(Map); | 2994 DISALLOW_IMPLICIT_CONSTRUCTORS(Map); |
| 3026 }; | 2995 }; |
| 3027 | 2996 |
| 3028 | 2997 |
| 3029 // An abstract superclass, a marker class really, for simple structure classes. | 2998 // An abstract superclass, a marker class really, for simple structure classes. |
| 3030 // It doesn't carry much functionality but allows struct classes to me | 2999 // It doesn't carry much functionality but allows struct classes to me |
| 3031 // identified in the type system. | 3000 // identified in the type system. |
| 3032 class Struct: public HeapObject { | 3001 class Struct: public HeapObject { |
| (...skipping 1938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4971 } else { | 4940 } else { |
| 4972 value &= ~(1 << bit_position); | 4941 value &= ~(1 << bit_position); |
| 4973 } | 4942 } |
| 4974 return value; | 4943 return value; |
| 4975 } | 4944 } |
| 4976 }; | 4945 }; |
| 4977 | 4946 |
| 4978 } } // namespace v8::internal | 4947 } } // namespace v8::internal |
| 4979 | 4948 |
| 4980 #endif // V8_OBJECTS_H_ | 4949 #endif // V8_OBJECTS_H_ |
| OLD | NEW |