| 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 // Returns the field at offset in obj, as a read/write Object* reference. | 1044 static inline Object* GetHeapObjectField(HeapObject* obj, int index); |
| 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); | |
| 1049 | 1045 |
| 1050 // Casting. | 1046 // Casting. |
| 1051 static inline HeapObject* cast(Object* obj); | 1047 static inline HeapObject* cast(Object* obj); |
| 1052 | 1048 |
| 1053 // Return the write barrier mode for this. | 1049 // Return the write barrier mode for this. |
| 1054 inline WriteBarrierMode GetWriteBarrierMode(); | 1050 inline WriteBarrierMode GetWriteBarrierMode(); |
| 1055 | 1051 |
| 1056 // Dispatched behavior. | 1052 // Dispatched behavior. |
| 1057 void HeapObjectShortPrint(StringStream* accumulator); | 1053 void HeapObjectShortPrint(StringStream* accumulator); |
| 1058 #ifdef DEBUG | 1054 #ifdef DEBUG |
| (...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2418 // Returns the found code or undefined if absent. | 2414 // Returns the found code or undefined if absent. |
| 2419 Object* FindInCodeCache(String* name, Code::Flags flags); | 2415 Object* FindInCodeCache(String* name, Code::Flags flags); |
| 2420 | 2416 |
| 2421 // Returns the non-negative index of the code object if it is in the | 2417 // Returns the non-negative index of the code object if it is in the |
| 2422 // cache and -1 otherwise. | 2418 // cache and -1 otherwise. |
| 2423 int IndexInCodeCache(Code* code); | 2419 int IndexInCodeCache(Code* code); |
| 2424 | 2420 |
| 2425 // Removes a code object from the code cache at the given index. | 2421 // Removes a code object from the code cache at the given index. |
| 2426 void RemoveFromCodeCache(int index); | 2422 void RemoveFromCodeCache(int index); |
| 2427 | 2423 |
| 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 | |
| 2439 // Dispatched behavior. | 2424 // Dispatched behavior. |
| 2440 void MapIterateBody(ObjectVisitor* v); | 2425 void MapIterateBody(ObjectVisitor* v); |
| 2441 #ifdef DEBUG | 2426 #ifdef DEBUG |
| 2442 void MapPrint(); | 2427 void MapPrint(); |
| 2443 void MapVerify(); | 2428 void MapVerify(); |
| 2444 #endif | 2429 #endif |
| 2445 | 2430 |
| 2446 // Layout description. | 2431 // Layout description. |
| 2447 static const int kInstanceSizesOffset = HeapObject::kHeaderSize; | 2432 static const int kInstanceSizesOffset = HeapObject::kHeaderSize; |
| 2448 static const int kInstanceAttributesOffset = kInstanceSizesOffset + kIntSize; | 2433 static const int kInstanceAttributesOffset = kInstanceSizesOffset + kIntSize; |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2813 // Forward declaration. | 2798 // Forward declaration. |
| 2814 class JSBuiltinsObject; | 2799 class JSBuiltinsObject; |
| 2815 | 2800 |
| 2816 // Common super class for JavaScript global objects and the special | 2801 // Common super class for JavaScript global objects and the special |
| 2817 // builtins global objects. | 2802 // builtins global objects. |
| 2818 class GlobalObject: public JSObject { | 2803 class GlobalObject: public JSObject { |
| 2819 public: | 2804 public: |
| 2820 // [builtins]: the object holding the runtime routines written in JS. | 2805 // [builtins]: the object holding the runtime routines written in JS. |
| 2821 DECL_ACCESSORS(builtins, JSBuiltinsObject) | 2806 DECL_ACCESSORS(builtins, JSBuiltinsObject) |
| 2822 | 2807 |
| 2823 // [global context]: the global context corresponding to this global object. | 2808 // [global context]: the global context corresponding to this global objet. |
| 2824 DECL_ACCESSORS(global_context, Context) | 2809 DECL_ACCESSORS(global_context, Context) |
| 2825 | 2810 |
| 2826 // [global receiver]: the global receiver object of the context | 2811 // [global receiver]: the global receiver object of the context |
| 2827 DECL_ACCESSORS(global_receiver, JSObject) | 2812 DECL_ACCESSORS(global_receiver, JSObject) |
| 2828 | 2813 |
| 2829 // Casting. | 2814 // Casting. |
| 2830 static inline GlobalObject* cast(Object* obj); | 2815 static inline GlobalObject* cast(Object* obj); |
| 2831 | 2816 |
| 2832 // Layout description. | 2817 // Layout description. |
| 2833 static const int kBuiltinsOffset = JSObject::kHeaderSize; | 2818 static const int kBuiltinsOffset = JSObject::kHeaderSize; |
| (...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4134 } else { | 4119 } else { |
| 4135 value &= ~(1 << bit_position); | 4120 value &= ~(1 << bit_position); |
| 4136 } | 4121 } |
| 4137 return value; | 4122 return value; |
| 4138 } | 4123 } |
| 4139 }; | 4124 }; |
| 4140 | 4125 |
| 4141 } } // namespace v8::internal | 4126 } } // namespace v8::internal |
| 4142 | 4127 |
| 4143 #endif // V8_OBJECTS_H_ | 4128 #endif // V8_OBJECTS_H_ |
| OLD | NEW |