| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 bool IsReadOnly() { return (attributes() & READ_ONLY) != 0; } | 172 bool IsReadOnly() { return (attributes() & READ_ONLY) != 0; } |
| 173 bool IsDontDelete() { return (attributes() & DONT_DELETE) != 0; } | 173 bool IsDontDelete() { return (attributes() & DONT_DELETE) != 0; } |
| 174 bool IsDontEnum() { return (attributes() & DONT_ENUM) != 0; } | 174 bool IsDontEnum() { return (attributes() & DONT_ENUM) != 0; } |
| 175 bool IsDeleted() { return DeletedField::decode(value_) != 0;} | 175 bool IsDeleted() { return DeletedField::decode(value_) != 0;} |
| 176 | 176 |
| 177 // Bit fields in value_ (type, shift, size). Must be public so the | 177 // Bit fields in value_ (type, shift, size). Must be public so the |
| 178 // constants can be embedded in generated code. | 178 // constants can be embedded in generated code. |
| 179 class TypeField: public BitField<PropertyType, 0, 3> {}; | 179 class TypeField: public BitField<PropertyType, 0, 3> {}; |
| 180 class AttributesField: public BitField<PropertyAttributes, 3, 3> {}; | 180 class AttributesField: public BitField<PropertyAttributes, 3, 3> {}; |
| 181 class DeletedField: public BitField<uint32_t, 6, 1> {}; | 181 class DeletedField: public BitField<uint32_t, 6, 1> {}; |
| 182 class IndexField: public BitField<uint32_t, 7, 31-7> {}; | 182 class IndexField: public BitField<uint32_t, 7, 32-7> {}; |
| 183 | 183 |
| 184 static const int kInitialIndex = 1; | 184 static const int kInitialIndex = 1; |
| 185 private: | 185 private: |
| 186 uint32_t value_; | 186 uint32_t value_; |
| 187 }; | 187 }; |
| 188 | 188 |
| 189 | 189 |
| 190 // Setter that skips the write barrier if mode is SKIP_WRITE_BARRIER. | 190 // Setter that skips the write barrier if mode is SKIP_WRITE_BARRIER. |
| 191 enum WriteBarrierMode { SKIP_WRITE_BARRIER, UPDATE_WRITE_BARRIER }; | 191 enum WriteBarrierMode { SKIP_WRITE_BARRIER, UPDATE_WRITE_BARRIER }; |
| 192 | 192 |
| (...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1154 inline bool HasDictionaryElements(); | 1154 inline bool HasDictionaryElements(); |
| 1155 inline bool HasPixelElements(); | 1155 inline bool HasPixelElements(); |
| 1156 inline bool HasExternalArrayElements(); | 1156 inline bool HasExternalArrayElements(); |
| 1157 inline bool HasExternalByteElements(); | 1157 inline bool HasExternalByteElements(); |
| 1158 inline bool HasExternalUnsignedByteElements(); | 1158 inline bool HasExternalUnsignedByteElements(); |
| 1159 inline bool HasExternalShortElements(); | 1159 inline bool HasExternalShortElements(); |
| 1160 inline bool HasExternalUnsignedShortElements(); | 1160 inline bool HasExternalUnsignedShortElements(); |
| 1161 inline bool HasExternalIntElements(); | 1161 inline bool HasExternalIntElements(); |
| 1162 inline bool HasExternalUnsignedIntElements(); | 1162 inline bool HasExternalUnsignedIntElements(); |
| 1163 inline bool HasExternalFloatElements(); | 1163 inline bool HasExternalFloatElements(); |
| 1164 inline bool AllowsSetElementsLength(); |
| 1164 inline NumberDictionary* element_dictionary(); // Gets slow elements. | 1165 inline NumberDictionary* element_dictionary(); // Gets slow elements. |
| 1165 | 1166 |
| 1166 // Collects elements starting at index 0. | 1167 // Collects elements starting at index 0. |
| 1167 // Undefined values are placed after non-undefined values. | 1168 // Undefined values are placed after non-undefined values. |
| 1168 // Returns the number of non-undefined values. | 1169 // Returns the number of non-undefined values. |
| 1169 Object* PrepareElementsForSort(uint32_t limit); | 1170 Object* PrepareElementsForSort(uint32_t limit); |
| 1170 // As PrepareElementsForSort, but only on objects where elements is | 1171 // As PrepareElementsForSort, but only on objects where elements is |
| 1171 // a dictionary, and it will stay a dictionary. | 1172 // a dictionary, and it will stay a dictionary. |
| 1172 Object* PrepareSlowElementsForSort(uint32_t limit); | 1173 Object* PrepareSlowElementsForSort(uint32_t limit); |
| 1173 | 1174 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1294 bool ShouldConvertToSlowElements(int new_capacity); | 1295 bool ShouldConvertToSlowElements(int new_capacity); |
| 1295 // Returns true if the backing storage for the slow-case elements of | 1296 // Returns true if the backing storage for the slow-case elements of |
| 1296 // this object takes up nearly as much space as a fast-case backing | 1297 // this object takes up nearly as much space as a fast-case backing |
| 1297 // storage would. In that case the JSObject should have fast | 1298 // storage would. In that case the JSObject should have fast |
| 1298 // elements. | 1299 // elements. |
| 1299 bool ShouldConvertToFastElements(); | 1300 bool ShouldConvertToFastElements(); |
| 1300 | 1301 |
| 1301 // Return the object's prototype (might be Heap::null_value()). | 1302 // Return the object's prototype (might be Heap::null_value()). |
| 1302 inline Object* GetPrototype(); | 1303 inline Object* GetPrototype(); |
| 1303 | 1304 |
| 1305 // Set the object's prototype (only JSObject and null are allowed). |
| 1306 Object* SetPrototype(Object* value, bool skip_hidden_prototypes); |
| 1307 |
| 1304 // Tells whether the index'th element is present. | 1308 // Tells whether the index'th element is present. |
| 1305 inline bool HasElement(uint32_t index); | 1309 inline bool HasElement(uint32_t index); |
| 1306 bool HasElementWithReceiver(JSObject* receiver, uint32_t index); | 1310 bool HasElementWithReceiver(JSObject* receiver, uint32_t index); |
| 1307 bool HasLocalElement(uint32_t index); | 1311 bool HasLocalElement(uint32_t index); |
| 1308 | 1312 |
| 1309 bool HasElementWithInterceptor(JSObject* receiver, uint32_t index); | 1313 bool HasElementWithInterceptor(JSObject* receiver, uint32_t index); |
| 1310 bool HasElementPostInterceptor(JSObject* receiver, uint32_t index); | 1314 bool HasElementPostInterceptor(JSObject* receiver, uint32_t index); |
| 1311 | 1315 |
| 1312 Object* SetFastElement(uint32_t index, Object* value); | 1316 Object* SetFastElement(uint32_t index, Object* value); |
| 1313 | 1317 |
| (...skipping 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3193 // Clear information on assignments of the form this.x = ...; | 3197 // Clear information on assignments of the form this.x = ...; |
| 3194 void ClearThisPropertyAssignmentsInfo(); | 3198 void ClearThisPropertyAssignmentsInfo(); |
| 3195 | 3199 |
| 3196 // Indicate that this function only consists of assignments of the form | 3200 // Indicate that this function only consists of assignments of the form |
| 3197 // this.x = y; where y is either a constant or refers to an argument. | 3201 // this.x = y; where y is either a constant or refers to an argument. |
| 3198 inline bool has_only_simple_this_property_assignments(); | 3202 inline bool has_only_simple_this_property_assignments(); |
| 3199 | 3203 |
| 3200 inline bool try_full_codegen(); | 3204 inline bool try_full_codegen(); |
| 3201 inline void set_try_full_codegen(bool flag); | 3205 inline void set_try_full_codegen(bool flag); |
| 3202 | 3206 |
| 3207 // Check whether a inlined constructor can be generated with the given |
| 3208 // prototype. |
| 3209 bool CanGenerateInlineConstructor(Object* prototype); |
| 3210 |
| 3203 // For functions which only contains this property assignments this provides | 3211 // For functions which only contains this property assignments this provides |
| 3204 // access to the names for the properties assigned. | 3212 // access to the names for the properties assigned. |
| 3205 DECL_ACCESSORS(this_property_assignments, Object) | 3213 DECL_ACCESSORS(this_property_assignments, Object) |
| 3206 inline int this_property_assignments_count(); | 3214 inline int this_property_assignments_count(); |
| 3207 inline void set_this_property_assignments_count(int value); | 3215 inline void set_this_property_assignments_count(int value); |
| 3208 String* GetThisPropertyAssignmentName(int index); | 3216 String* GetThisPropertyAssignmentName(int index); |
| 3209 bool IsThisPropertyAssignmentArgument(int index); | 3217 bool IsThisPropertyAssignmentArgument(int index); |
| 3210 int GetThisPropertyAssignmentArgument(int index); | 3218 int GetThisPropertyAssignmentArgument(int index); |
| 3211 Object* GetThisPropertyAssignmentConstant(int index); | 3219 Object* GetThisPropertyAssignmentConstant(int index); |
| 3212 | 3220 |
| (...skipping 1728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4941 } else { | 4949 } else { |
| 4942 value &= ~(1 << bit_position); | 4950 value &= ~(1 << bit_position); |
| 4943 } | 4951 } |
| 4944 return value; | 4952 return value; |
| 4945 } | 4953 } |
| 4946 }; | 4954 }; |
| 4947 | 4955 |
| 4948 } } // namespace v8::internal | 4956 } } // namespace v8::internal |
| 4949 | 4957 |
| 4950 #endif // V8_OBJECTS_H_ | 4958 #endif // V8_OBJECTS_H_ |
| OLD | NEW |