| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
| 6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 | 9 |
| 10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| (...skipping 9645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9656 | 9656 |
| 9657 static bool SetupAllocatingData(Handle<JSArrayBuffer> array_buffer, | 9657 static bool SetupAllocatingData(Handle<JSArrayBuffer> array_buffer, |
| 9658 Isolate* isolate, size_t allocated_length, | 9658 Isolate* isolate, size_t allocated_length, |
| 9659 bool initialize = true, | 9659 bool initialize = true, |
| 9660 SharedFlag shared = SharedFlag::kNotShared); | 9660 SharedFlag shared = SharedFlag::kNotShared); |
| 9661 | 9661 |
| 9662 // Dispatched behavior. | 9662 // Dispatched behavior. |
| 9663 DECLARE_PRINTER(JSArrayBuffer) | 9663 DECLARE_PRINTER(JSArrayBuffer) |
| 9664 DECLARE_VERIFIER(JSArrayBuffer) | 9664 DECLARE_VERIFIER(JSArrayBuffer) |
| 9665 | 9665 |
| 9666 static const int kBackingStoreOffset = JSObject::kHeaderSize; | 9666 static const int kByteLengthOffset = JSObject::kHeaderSize; |
| 9667 static const int kByteLengthOffset = kBackingStoreOffset + kPointerSize; | 9667 |
| 9668 static const int kBitFieldSlot = kByteLengthOffset + kPointerSize; | 9668 // NOTE: GC will visit objects fields: |
| 9669 // 1. From JSObject::BodyDescriptor::kStartOffset to kByteLengthOffset + |
| 9670 // kPointerSize |
| 9671 // 2. From start of the internal fields and up to the end of them |
| 9672 static const int kBackingStoreOffset = kByteLengthOffset + kPointerSize; |
| 9673 static const int kBitFieldSlot = kBackingStoreOffset + kPointerSize; |
| 9669 #if V8_TARGET_LITTLE_ENDIAN || !V8_HOST_ARCH_64_BIT | 9674 #if V8_TARGET_LITTLE_ENDIAN || !V8_HOST_ARCH_64_BIT |
| 9670 static const int kBitFieldOffset = kBitFieldSlot; | 9675 static const int kBitFieldOffset = kBitFieldSlot; |
| 9671 #else | 9676 #else |
| 9672 static const int kBitFieldOffset = kBitFieldSlot + kIntSize; | 9677 static const int kBitFieldOffset = kBitFieldSlot + kIntSize; |
| 9673 #endif | 9678 #endif |
| 9674 static const int kSize = kBitFieldSlot + kPointerSize; | 9679 static const int kSize = kBitFieldSlot + kPointerSize; |
| 9675 | 9680 |
| 9676 static const int kSizeWithInternalFields = | 9681 static const int kSizeWithInternalFields = |
| 9677 kSize + v8::ArrayBuffer::kInternalFieldCount * kPointerSize; | 9682 kSize + v8::ArrayBuffer::kInternalFieldCount * kPointerSize; |
| 9678 | 9683 |
| 9684 template <typename StaticVisitor> |
| 9685 static inline void JSArrayBufferIterateBody(Heap* heap, HeapObject* obj); |
| 9686 |
| 9687 static inline void JSArrayBufferIterateBody(HeapObject* obj, |
| 9688 ObjectVisitor* v); |
| 9689 |
| 9679 class IsExternal : public BitField<bool, 1, 1> {}; | 9690 class IsExternal : public BitField<bool, 1, 1> {}; |
| 9680 class IsNeuterable : public BitField<bool, 2, 1> {}; | 9691 class IsNeuterable : public BitField<bool, 2, 1> {}; |
| 9681 class WasNeutered : public BitField<bool, 3, 1> {}; | 9692 class WasNeutered : public BitField<bool, 3, 1> {}; |
| 9682 class IsShared : public BitField<bool, 4, 1> {}; | 9693 class IsShared : public BitField<bool, 4, 1> {}; |
| 9683 | 9694 |
| 9684 private: | 9695 private: |
| 9685 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArrayBuffer); | 9696 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArrayBuffer); |
| 9686 }; | 9697 }; |
| 9687 | 9698 |
| 9688 | 9699 |
| (...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10466 } else { | 10477 } else { |
| 10467 value &= ~(1 << bit_position); | 10478 value &= ~(1 << bit_position); |
| 10468 } | 10479 } |
| 10469 return value; | 10480 return value; |
| 10470 } | 10481 } |
| 10471 }; | 10482 }; |
| 10472 | 10483 |
| 10473 } } // namespace v8::internal | 10484 } } // namespace v8::internal |
| 10474 | 10485 |
| 10475 #endif // V8_OBJECTS_H_ | 10486 #endif // V8_OBJECTS_H_ |
| OLD | NEW |