| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 5748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5759 Representation new_representation, | 5759 Representation new_representation, |
| 5760 Handle<HeapType> new_field_type, | 5760 Handle<HeapType> new_field_type, |
| 5761 StoreMode store_mode); | 5761 StoreMode store_mode); |
| 5762 static Handle<Map> CopyGeneralizeAllRepresentations( | 5762 static Handle<Map> CopyGeneralizeAllRepresentations( |
| 5763 Handle<Map> map, int modify_index, StoreMode store_mode, | 5763 Handle<Map> map, int modify_index, StoreMode store_mode, |
| 5764 PropertyKind kind, PropertyAttributes attributes, const char* reason); | 5764 PropertyKind kind, PropertyAttributes attributes, const char* reason); |
| 5765 | 5765 |
| 5766 static Handle<Map> PrepareForDataProperty(Handle<Map> old_map, | 5766 static Handle<Map> PrepareForDataProperty(Handle<Map> old_map, |
| 5767 int descriptor_number, | 5767 int descriptor_number, |
| 5768 Handle<Object> value); | 5768 Handle<Object> value); |
| 5769 static Handle<Map> PrepareForDataElement(Handle<Map> old_map, | |
| 5770 Handle<Object> value); | |
| 5771 | 5769 |
| 5772 static Handle<Map> Normalize(Handle<Map> map, PropertyNormalizationMode mode, | 5770 static Handle<Map> Normalize(Handle<Map> map, PropertyNormalizationMode mode, |
| 5773 const char* reason); | 5771 const char* reason); |
| 5774 | 5772 |
| 5775 // Returns the constructor name (the name (possibly, inferred name) of the | 5773 // Returns the constructor name (the name (possibly, inferred name) of the |
| 5776 // function that was used to instantiate the object). | 5774 // function that was used to instantiate the object). |
| 5777 String* constructor_name(); | 5775 String* constructor_name(); |
| 5778 | 5776 |
| 5779 // Tells whether the map is used for JSObjects in dictionary mode (ie | 5777 // Tells whether the map is used for JSObjects in dictionary mode (ie |
| 5780 // normalized objects, ie objects for which HasFastProperties returns false). | 5778 // normalized objects, ie objects for which HasFastProperties returns false). |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6023 | 6021 |
| 6024 bool CanTransition() { | 6022 bool CanTransition() { |
| 6025 // Only JSObject and subtypes have map transitions and back pointers. | 6023 // Only JSObject and subtypes have map transitions and back pointers. |
| 6026 STATIC_ASSERT(LAST_TYPE == LAST_JS_OBJECT_TYPE); | 6024 STATIC_ASSERT(LAST_TYPE == LAST_JS_OBJECT_TYPE); |
| 6027 return instance_type() >= FIRST_JS_OBJECT_TYPE; | 6025 return instance_type() >= FIRST_JS_OBJECT_TYPE; |
| 6028 } | 6026 } |
| 6029 | 6027 |
| 6030 bool IsJSObjectMap() { | 6028 bool IsJSObjectMap() { |
| 6031 return instance_type() >= FIRST_JS_OBJECT_TYPE; | 6029 return instance_type() >= FIRST_JS_OBJECT_TYPE; |
| 6032 } | 6030 } |
| 6031 bool IsJSArrayMap() { return instance_type() == JS_ARRAY_TYPE; } |
| 6033 bool IsStringMap() { return instance_type() < FIRST_NONSTRING_TYPE; } | 6032 bool IsStringMap() { return instance_type() < FIRST_NONSTRING_TYPE; } |
| 6034 bool IsJSProxyMap() { | 6033 bool IsJSProxyMap() { |
| 6035 InstanceType type = instance_type(); | 6034 InstanceType type = instance_type(); |
| 6036 return FIRST_JS_PROXY_TYPE <= type && type <= LAST_JS_PROXY_TYPE; | 6035 return FIRST_JS_PROXY_TYPE <= type && type <= LAST_JS_PROXY_TYPE; |
| 6037 } | 6036 } |
| 6038 bool IsJSGlobalProxyMap() { | 6037 bool IsJSGlobalProxyMap() { |
| 6039 return instance_type() == JS_GLOBAL_PROXY_TYPE; | 6038 return instance_type() == JS_GLOBAL_PROXY_TYPE; |
| 6040 } | 6039 } |
| 6041 bool IsJSGlobalObjectMap() { | 6040 bool IsJSGlobalObjectMap() { |
| 6042 return instance_type() == JS_GLOBAL_OBJECT_TYPE; | 6041 return instance_type() == JS_GLOBAL_OBJECT_TYPE; |
| (...skipping 4753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10796 } else { | 10795 } else { |
| 10797 value &= ~(1 << bit_position); | 10796 value &= ~(1 << bit_position); |
| 10798 } | 10797 } |
| 10799 return value; | 10798 return value; |
| 10800 } | 10799 } |
| 10801 }; | 10800 }; |
| 10802 | 10801 |
| 10803 } } // namespace v8::internal | 10802 } } // namespace v8::internal |
| 10804 | 10803 |
| 10805 #endif // V8_OBJECTS_H_ | 10804 #endif // V8_OBJECTS_H_ |
| OLD | NEW |