| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1016 | 1016 |
| 1017 // Returns the field at offset in obj, as a read/write Object* reference. | 1017 // Returns the field at offset in obj, as a read/write Object* reference. |
| 1018 // Does no checking, and is safe to use during GC, while maps are invalid. | 1018 // Does no checking, and is safe to use during GC, while maps are invalid. |
| 1019 // Does not update remembered sets, so should only be assigned to | 1019 // Does not update remembered sets, so should only be assigned to |
| 1020 // during marking GC. | 1020 // during marking GC. |
| 1021 static inline Object** RawField(HeapObject* obj, int offset); | 1021 static inline Object** RawField(HeapObject* obj, int offset); |
| 1022 | 1022 |
| 1023 // Casting. | 1023 // Casting. |
| 1024 static inline HeapObject* cast(Object* obj); | 1024 static inline HeapObject* cast(Object* obj); |
| 1025 | 1025 |
| 1026 // Return the write barrier mode for this. | 1026 // Return the write barrier mode for this. Callers of this function |
| 1027 inline WriteBarrierMode GetWriteBarrierMode(); | 1027 // must be able to present a reference to an AssertNoAllocation |
| 1028 // object as a sign that they are not going to use this function |
| 1029 // from code that allocates and thus invalidates the returned write |
| 1030 // barrier mode. |
| 1031 inline WriteBarrierMode GetWriteBarrierMode(const AssertNoAllocation&); |
| 1028 | 1032 |
| 1029 // Dispatched behavior. | 1033 // Dispatched behavior. |
| 1030 void HeapObjectShortPrint(StringStream* accumulator); | 1034 void HeapObjectShortPrint(StringStream* accumulator); |
| 1031 #ifdef DEBUG | 1035 #ifdef DEBUG |
| 1032 void HeapObjectPrint(); | 1036 void HeapObjectPrint(); |
| 1033 void HeapObjectVerify(); | 1037 void HeapObjectVerify(); |
| 1034 inline void VerifyObjectField(int offset); | 1038 inline void VerifyObjectField(int offset); |
| 1035 | 1039 |
| 1036 void PrintHeader(const char* id); | 1040 void PrintHeader(const char* id); |
| 1037 | 1041 |
| (...skipping 3430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4468 // The JSArray describes JavaScript Arrays | 4472 // The JSArray describes JavaScript Arrays |
| 4469 // Such an array can be in one of two modes: | 4473 // Such an array can be in one of two modes: |
| 4470 // - fast, backing storage is a FixedArray and length <= elements.length(); | 4474 // - fast, backing storage is a FixedArray and length <= elements.length(); |
| 4471 // Please note: push and pop can be used to grow and shrink the array. | 4475 // Please note: push and pop can be used to grow and shrink the array. |
| 4472 // - slow, backing storage is a HashTable with numbers as keys. | 4476 // - slow, backing storage is a HashTable with numbers as keys. |
| 4473 class JSArray: public JSObject { | 4477 class JSArray: public JSObject { |
| 4474 public: | 4478 public: |
| 4475 // [length]: The length property. | 4479 // [length]: The length property. |
| 4476 DECL_ACCESSORS(length, Object) | 4480 DECL_ACCESSORS(length, Object) |
| 4477 | 4481 |
| 4482 // Overload the length setter to skip write barrier when the length |
| 4483 // is set to a smi. This matches the set function on FixedArray. |
| 4484 inline void set_length(Smi* length); |
| 4485 |
| 4478 Object* JSArrayUpdateLengthFromIndex(uint32_t index, Object* value); | 4486 Object* JSArrayUpdateLengthFromIndex(uint32_t index, Object* value); |
| 4479 | 4487 |
| 4480 // Initialize the array with the given capacity. The function may | 4488 // Initialize the array with the given capacity. The function may |
| 4481 // fail due to out-of-memory situations, but only if the requested | 4489 // fail due to out-of-memory situations, but only if the requested |
| 4482 // capacity is non-zero. | 4490 // capacity is non-zero. |
| 4483 Object* Initialize(int capacity); | 4491 Object* Initialize(int capacity); |
| 4484 | 4492 |
| 4485 // Set the content of the array to the content of storage. | 4493 // Set the content of the array to the content of storage. |
| 4486 inline void SetContent(FixedArray* storage); | 4494 inline void SetContent(FixedArray* storage); |
| 4487 | 4495 |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4963 } else { | 4971 } else { |
| 4964 value &= ~(1 << bit_position); | 4972 value &= ~(1 << bit_position); |
| 4965 } | 4973 } |
| 4966 return value; | 4974 return value; |
| 4967 } | 4975 } |
| 4968 }; | 4976 }; |
| 4969 | 4977 |
| 4970 } } // namespace v8::internal | 4978 } } // namespace v8::internal |
| 4971 | 4979 |
| 4972 #endif // V8_OBJECTS_H_ | 4980 #endif // V8_OBJECTS_H_ |
| OLD | NEW |