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