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 |
1759 // Casting. | 1766 // Casting. |
1760 static inline HeapObject* cast(Object* obj); | 1767 static inline HeapObject* cast(Object* obj); |
1761 | 1768 |
1762 // Return the write barrier mode for this. Callers of this function | 1769 // Return the write barrier mode for this. Callers of this function |
1763 // must be able to present a reference to an DisallowHeapAllocation | 1770 // must be able to present a reference to an DisallowHeapAllocation |
1764 // object as a sign that they are not going to use this function | 1771 // object as a sign that they are not going to use this function |
1765 // from code that allocates and thus invalidates the returned write | 1772 // from code that allocates and thus invalidates the returned write |
1766 // barrier mode. | 1773 // barrier mode. |
1767 inline WriteBarrierMode GetWriteBarrierMode( | 1774 inline WriteBarrierMode GetWriteBarrierMode( |
1768 const DisallowHeapAllocation& promise); | 1775 const DisallowHeapAllocation& promise); |
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2567 PropertyNormalizationMode mode, | 2574 PropertyNormalizationMode mode, |
2568 int expected_additional_properties); | 2575 int expected_additional_properties); |
2569 | 2576 |
2570 // Convert and update the elements backing store to be a | 2577 // Convert and update the elements backing store to be a |
2571 // SeededNumberDictionary dictionary. Returns the backing after conversion. | 2578 // SeededNumberDictionary dictionary. Returns the backing after conversion. |
2572 static Handle<SeededNumberDictionary> NormalizeElements( | 2579 static Handle<SeededNumberDictionary> NormalizeElements( |
2573 Handle<JSObject> object); | 2580 Handle<JSObject> object); |
2574 | 2581 |
2575 MUST_USE_RESULT MaybeObject* NormalizeElements(); | 2582 MUST_USE_RESULT MaybeObject* NormalizeElements(); |
2576 | 2583 |
2577 static void UpdateMapCodeCache(Handle<JSObject> object, | |
2578 Handle<Name> name, | |
2579 Handle<Code> code); | |
2580 | |
2581 // Transform slow named properties to fast variants. | 2584 // Transform slow named properties to fast variants. |
2582 // Returns failure if allocation failed. | 2585 // Returns failure if allocation failed. |
2583 static void TransformToFastProperties(Handle<JSObject> object, | 2586 static void TransformToFastProperties(Handle<JSObject> object, |
2584 int unused_property_fields); | 2587 int unused_property_fields); |
2585 | 2588 |
2586 MUST_USE_RESULT MaybeObject* TransformToFastProperties( | 2589 MUST_USE_RESULT MaybeObject* TransformToFastProperties( |
2587 int unused_property_fields); | 2590 int unused_property_fields); |
2588 | 2591 |
2589 // Access fast-case object properties at index. | 2592 // Access fast-case object properties at index. |
2590 MUST_USE_RESULT inline MaybeObject* FastPropertyAt( | 2593 MUST_USE_RESULT inline MaybeObject* FastPropertyAt( |
(...skipping 3311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5902 // heap verification is turned on. | 5905 // heap verification is turned on. |
5903 void ZapPrototypeTransitions(); | 5906 void ZapPrototypeTransitions(); |
5904 void ZapTransitions(); | 5907 void ZapTransitions(); |
5905 | 5908 |
5906 bool CanTransition() { | 5909 bool CanTransition() { |
5907 // Only JSObject and subtypes have map transitions and back pointers. | 5910 // Only JSObject and subtypes have map transitions and back pointers. |
5908 STATIC_ASSERT(LAST_TYPE == LAST_JS_OBJECT_TYPE); | 5911 STATIC_ASSERT(LAST_TYPE == LAST_JS_OBJECT_TYPE); |
5909 return instance_type() >= FIRST_JS_OBJECT_TYPE; | 5912 return instance_type() >= FIRST_JS_OBJECT_TYPE; |
5910 } | 5913 } |
5911 | 5914 |
| 5915 bool IsJSObjectMap() { |
| 5916 return instance_type() >= FIRST_JS_OBJECT_TYPE; |
| 5917 } |
| 5918 |
5912 // Fires when the layout of an object with a leaf map changes. | 5919 // Fires when the layout of an object with a leaf map changes. |
5913 // This includes adding transitions to the leaf map or changing | 5920 // This includes adding transitions to the leaf map or changing |
5914 // the descriptor array. | 5921 // the descriptor array. |
5915 inline void NotifyLeafMapLayoutChange(); | 5922 inline void NotifyLeafMapLayoutChange(); |
5916 | 5923 |
5917 inline bool CanOmitMapChecks(); | 5924 inline bool CanOmitMapChecks(); |
5918 | 5925 |
5919 void AddDependentCompilationInfo(DependentCode::DependencyGroup group, | 5926 void AddDependentCompilationInfo(DependentCode::DependencyGroup group, |
5920 CompilationInfo* info); | 5927 CompilationInfo* info); |
5921 | 5928 |
(...skipping 4302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10224 } else { | 10231 } else { |
10225 value &= ~(1 << bit_position); | 10232 value &= ~(1 << bit_position); |
10226 } | 10233 } |
10227 return value; | 10234 return value; |
10228 } | 10235 } |
10229 }; | 10236 }; |
10230 | 10237 |
10231 } } // namespace v8::internal | 10238 } } // namespace v8::internal |
10232 | 10239 |
10233 #endif // V8_OBJECTS_H_ | 10240 #endif // V8_OBJECTS_H_ |
OLD | NEW |