OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1036 inline bool IsOverflowed(); | 1036 inline bool IsOverflowed(); |
1037 | 1037 |
1038 // Mutate this object's map pointer to indicate that the object is | 1038 // Mutate this object's map pointer to indicate that the object is |
1039 // overflowed. | 1039 // overflowed. |
1040 inline void SetOverflow(); | 1040 inline void SetOverflow(); |
1041 | 1041 |
1042 // Mutate this object's map pointer to remove the indication that the | 1042 // Mutate this object's map pointer to remove the indication that the |
1043 // object is overflowed (ie, partially restore the map pointer). | 1043 // object is overflowed (ie, partially restore the map pointer). |
1044 inline void ClearOverflow(); | 1044 inline void ClearOverflow(); |
1045 | 1045 |
1046 static inline Object* GetHeapObjectField(HeapObject* obj, int index); | 1046 // Returns the field at offset in obj, as a read/write Object* reference. |
| 1047 // Does no checking, and is safe to use during GC, while maps are invalid. |
| 1048 // Does not update remembered sets, so should only be assigned to |
| 1049 // during marking GC. |
| 1050 static inline Object** RawField(HeapObject* obj, int offset); |
1047 | 1051 |
1048 // Casting. | 1052 // Casting. |
1049 static inline HeapObject* cast(Object* obj); | 1053 static inline HeapObject* cast(Object* obj); |
1050 | 1054 |
1051 // Return the write barrier mode for this. | 1055 // Return the write barrier mode for this. |
1052 inline WriteBarrierMode GetWriteBarrierMode(); | 1056 inline WriteBarrierMode GetWriteBarrierMode(); |
1053 | 1057 |
1054 // Dispatched behavior. | 1058 // Dispatched behavior. |
1055 void HeapObjectShortPrint(StringStream* accumulator); | 1059 void HeapObjectShortPrint(StringStream* accumulator); |
1056 #ifdef DEBUG | 1060 #ifdef DEBUG |
(...skipping 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2413 // Returns the found code or undefined if absent. | 2417 // Returns the found code or undefined if absent. |
2414 Object* FindInCodeCache(String* name, Code::Flags flags); | 2418 Object* FindInCodeCache(String* name, Code::Flags flags); |
2415 | 2419 |
2416 // Returns the non-negative index of the code object if it is in the | 2420 // Returns the non-negative index of the code object if it is in the |
2417 // cache and -1 otherwise. | 2421 // cache and -1 otherwise. |
2418 int IndexInCodeCache(Code* code); | 2422 int IndexInCodeCache(Code* code); |
2419 | 2423 |
2420 // Removes a code object from the code cache at the given index. | 2424 // Removes a code object from the code cache at the given index. |
2421 void RemoveFromCodeCache(int index); | 2425 void RemoveFromCodeCache(int index); |
2422 | 2426 |
| 2427 // For every transition in this map, makes the transition's |
| 2428 // target's prototype pointer point back to this map. |
| 2429 // This is undone in MarkCompactCollector::ClearNonLiveTransitions(). |
| 2430 void CreateBackPointers(); |
| 2431 |
| 2432 // Set all map transitions from this map to dead maps to null. |
| 2433 // Also, restore the original prototype on the targets of these |
| 2434 // transitions, so that we do not process this map again while |
| 2435 // following back pointers. |
| 2436 void ClearNonLiveTransitions(Object* real_prototype); |
| 2437 |
2423 // Dispatched behavior. | 2438 // Dispatched behavior. |
2424 void MapIterateBody(ObjectVisitor* v); | 2439 void MapIterateBody(ObjectVisitor* v); |
2425 #ifdef DEBUG | 2440 #ifdef DEBUG |
2426 void MapPrint(); | 2441 void MapPrint(); |
2427 void MapVerify(); | 2442 void MapVerify(); |
2428 #endif | 2443 #endif |
2429 | 2444 |
2430 // Layout description. | 2445 // Layout description. |
2431 static const int kInstanceSizesOffset = HeapObject::kHeaderSize; | 2446 static const int kInstanceSizesOffset = HeapObject::kHeaderSize; |
2432 static const int kInstanceAttributesOffset = kInstanceSizesOffset + kIntSize; | 2447 static const int kInstanceAttributesOffset = kInstanceSizesOffset + kIntSize; |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2797 // Forward declaration. | 2812 // Forward declaration. |
2798 class JSBuiltinsObject; | 2813 class JSBuiltinsObject; |
2799 | 2814 |
2800 // Common super class for JavaScript global objects and the special | 2815 // Common super class for JavaScript global objects and the special |
2801 // builtins global objects. | 2816 // builtins global objects. |
2802 class GlobalObject: public JSObject { | 2817 class GlobalObject: public JSObject { |
2803 public: | 2818 public: |
2804 // [builtins]: the object holding the runtime routines written in JS. | 2819 // [builtins]: the object holding the runtime routines written in JS. |
2805 DECL_ACCESSORS(builtins, JSBuiltinsObject) | 2820 DECL_ACCESSORS(builtins, JSBuiltinsObject) |
2806 | 2821 |
2807 // [global context]: the global context corresponding to this global objet. | 2822 // [global context]: the global context corresponding to this global object. |
2808 DECL_ACCESSORS(global_context, Context) | 2823 DECL_ACCESSORS(global_context, Context) |
2809 | 2824 |
2810 // [global receiver]: the global receiver object of the context | 2825 // [global receiver]: the global receiver object of the context |
2811 DECL_ACCESSORS(global_receiver, JSObject) | 2826 DECL_ACCESSORS(global_receiver, JSObject) |
2812 | 2827 |
2813 // Casting. | 2828 // Casting. |
2814 static inline GlobalObject* cast(Object* obj); | 2829 static inline GlobalObject* cast(Object* obj); |
2815 | 2830 |
2816 // Layout description. | 2831 // Layout description. |
2817 static const int kBuiltinsOffset = JSObject::kHeaderSize; | 2832 static const int kBuiltinsOffset = JSObject::kHeaderSize; |
(...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4118 } else { | 4133 } else { |
4119 value &= ~(1 << bit_position); | 4134 value &= ~(1 << bit_position); |
4120 } | 4135 } |
4121 return value; | 4136 return value; |
4122 } | 4137 } |
4123 }; | 4138 }; |
4124 | 4139 |
4125 } } // namespace v8::internal | 4140 } } // namespace v8::internal |
4126 | 4141 |
4127 #endif // V8_OBJECTS_H_ | 4142 #endif // V8_OBJECTS_H_ |
OLD | NEW |