OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1749 // Useful when the map pointer field is used for other purposes. | 1749 // Useful when the map pointer field is used for other purposes. |
1750 // GC internal. | 1750 // GC internal. |
1751 inline int SizeFromMap(Map* map); | 1751 inline int SizeFromMap(Map* map); |
1752 | 1752 |
1753 // Returns the field at offset in obj, as a read/write Object* reference. | 1753 // Returns the field at offset in obj, as a read/write Object* reference. |
1754 // Does no checking, and is safe to use during GC, while maps are invalid. | 1754 // Does no checking, and is safe to use during GC, while maps are invalid. |
1755 // Does not invoke write barrier, so should only be assigned to | 1755 // Does not invoke write barrier, so should only be assigned to |
1756 // during marking GC. | 1756 // during marking GC. |
1757 static inline Object** RawField(HeapObject* obj, int offset); | 1757 static inline Object** RawField(HeapObject* obj, int offset); |
1758 | 1758 |
1759 // Adds the |code| object related to |name| to the code cache of this map. If | |
1760 // this map is a dictionary map that is shared, the map copied and installed | |
1761 // onto the object. | |
1762 static void UpdateMapCodeCache(Handle<HeapObject> object, | |
1763 Handle<Name> name, | |
1764 Handle<Code> code); | |
1765 | |
1766 // Casting. | 1759 // Casting. |
1767 static inline HeapObject* cast(Object* obj); | 1760 static inline HeapObject* cast(Object* obj); |
1768 | 1761 |
1769 // Return the write barrier mode for this. Callers of this function | 1762 // Return the write barrier mode for this. Callers of this function |
1770 // must be able to present a reference to an DisallowHeapAllocation | 1763 // must be able to present a reference to an DisallowHeapAllocation |
1771 // object as a sign that they are not going to use this function | 1764 // object as a sign that they are not going to use this function |
1772 // from code that allocates and thus invalidates the returned write | 1765 // from code that allocates and thus invalidates the returned write |
1773 // barrier mode. | 1766 // barrier mode. |
1774 inline WriteBarrierMode GetWriteBarrierMode( | 1767 inline WriteBarrierMode GetWriteBarrierMode( |
1775 const DisallowHeapAllocation& promise); | 1768 const DisallowHeapAllocation& promise); |
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2567 PropertyNormalizationMode mode, | 2560 PropertyNormalizationMode mode, |
2568 int expected_additional_properties); | 2561 int expected_additional_properties); |
2569 | 2562 |
2570 // Convert and update the elements backing store to be a | 2563 // Convert and update the elements backing store to be a |
2571 // SeededNumberDictionary dictionary. Returns the backing after conversion. | 2564 // SeededNumberDictionary dictionary. Returns the backing after conversion. |
2572 static Handle<SeededNumberDictionary> NormalizeElements( | 2565 static Handle<SeededNumberDictionary> NormalizeElements( |
2573 Handle<JSObject> object); | 2566 Handle<JSObject> object); |
2574 | 2567 |
2575 MUST_USE_RESULT MaybeObject* NormalizeElements(); | 2568 MUST_USE_RESULT MaybeObject* NormalizeElements(); |
2576 | 2569 |
| 2570 static void UpdateMapCodeCache(Handle<JSObject> object, |
| 2571 Handle<Name> name, |
| 2572 Handle<Code> code); |
| 2573 |
2577 // Transform slow named properties to fast variants. | 2574 // Transform slow named properties to fast variants. |
2578 // Returns failure if allocation failed. | 2575 // Returns failure if allocation failed. |
2579 static void TransformToFastProperties(Handle<JSObject> object, | 2576 static void TransformToFastProperties(Handle<JSObject> object, |
2580 int unused_property_fields); | 2577 int unused_property_fields); |
2581 | 2578 |
2582 MUST_USE_RESULT MaybeObject* TransformToFastProperties( | 2579 MUST_USE_RESULT MaybeObject* TransformToFastProperties( |
2583 int unused_property_fields); | 2580 int unused_property_fields); |
2584 | 2581 |
2585 // Access fast-case object properties at index. | 2582 // Access fast-case object properties at index. |
2586 MUST_USE_RESULT inline MaybeObject* FastPropertyAt( | 2583 MUST_USE_RESULT inline MaybeObject* FastPropertyAt( |
(...skipping 3330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5917 // heap verification is turned on. | 5914 // heap verification is turned on. |
5918 void ZapPrototypeTransitions(); | 5915 void ZapPrototypeTransitions(); |
5919 void ZapTransitions(); | 5916 void ZapTransitions(); |
5920 | 5917 |
5921 bool CanTransition() { | 5918 bool CanTransition() { |
5922 // Only JSObject and subtypes have map transitions and back pointers. | 5919 // Only JSObject and subtypes have map transitions and back pointers. |
5923 STATIC_ASSERT(LAST_TYPE == LAST_JS_OBJECT_TYPE); | 5920 STATIC_ASSERT(LAST_TYPE == LAST_JS_OBJECT_TYPE); |
5924 return instance_type() >= FIRST_JS_OBJECT_TYPE; | 5921 return instance_type() >= FIRST_JS_OBJECT_TYPE; |
5925 } | 5922 } |
5926 | 5923 |
5927 bool IsJSObjectMap() { | |
5928 return instance_type() >= FIRST_JS_OBJECT_TYPE; | |
5929 } | |
5930 | |
5931 // Fires when the layout of an object with a leaf map changes. | 5924 // Fires when the layout of an object with a leaf map changes. |
5932 // This includes adding transitions to the leaf map or changing | 5925 // This includes adding transitions to the leaf map or changing |
5933 // the descriptor array. | 5926 // the descriptor array. |
5934 inline void NotifyLeafMapLayoutChange(); | 5927 inline void NotifyLeafMapLayoutChange(); |
5935 | 5928 |
5936 inline bool CanOmitMapChecks(); | 5929 inline bool CanOmitMapChecks(); |
5937 | 5930 |
5938 void AddDependentCompilationInfo(DependentCode::DependencyGroup group, | 5931 void AddDependentCompilationInfo(DependentCode::DependencyGroup group, |
5939 CompilationInfo* info); | 5932 CompilationInfo* info); |
5940 | 5933 |
(...skipping 4300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10241 } else { | 10234 } else { |
10242 value &= ~(1 << bit_position); | 10235 value &= ~(1 << bit_position); |
10243 } | 10236 } |
10244 return value; | 10237 return value; |
10245 } | 10238 } |
10246 }; | 10239 }; |
10247 | 10240 |
10248 } } // namespace v8::internal | 10241 } } // namespace v8::internal |
10249 | 10242 |
10250 #endif // V8_OBJECTS_H_ | 10243 #endif // V8_OBJECTS_H_ |
OLD | NEW |