Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(859)

Unified Diff: src/objects.h

Issue 1061753008: Revert of Remove the weak list of views from array buffers (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index b5971305c0e1a13ee640bb23201060b90d7d3b2f..fd9e8f49333c6884385c2802606f08d6c1ac534e 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -4650,9 +4650,9 @@
// This accessor applies the correct conversion from Smi, HeapNumber
// and undefined and clamps the converted value between 0 and 255.
- static Handle<Object> SetValue(Handle<JSObject> holder,
- Handle<ExternalUint8ClampedArray> array,
- uint32_t index, Handle<Object> value);
+ static Handle<Object> SetValue(Handle<ExternalUint8ClampedArray> array,
+ uint32_t index,
+ Handle<Object> value);
DECLARE_CAST(ExternalUint8ClampedArray)
@@ -4674,9 +4674,9 @@
// This accessor applies the correct conversion from Smi, HeapNumber
// and undefined.
- static Handle<Object> SetValue(Handle<JSObject> holder,
- Handle<ExternalInt8Array> array,
- uint32_t index, Handle<Object> value);
+ static Handle<Object> SetValue(Handle<ExternalInt8Array> array,
+ uint32_t index,
+ Handle<Object> value);
DECLARE_CAST(ExternalInt8Array)
@@ -4698,9 +4698,9 @@
// This accessor applies the correct conversion from Smi, HeapNumber
// and undefined.
- static Handle<Object> SetValue(Handle<JSObject> holder,
- Handle<ExternalUint8Array> array,
- uint32_t index, Handle<Object> value);
+ static Handle<Object> SetValue(Handle<ExternalUint8Array> array,
+ uint32_t index,
+ Handle<Object> value);
DECLARE_CAST(ExternalUint8Array)
@@ -4722,9 +4722,9 @@
// This accessor applies the correct conversion from Smi, HeapNumber
// and undefined.
- static Handle<Object> SetValue(Handle<JSObject> holder,
- Handle<ExternalInt16Array> array,
- uint32_t index, Handle<Object> value);
+ static Handle<Object> SetValue(Handle<ExternalInt16Array> array,
+ uint32_t index,
+ Handle<Object> value);
DECLARE_CAST(ExternalInt16Array)
@@ -4747,9 +4747,9 @@
// This accessor applies the correct conversion from Smi, HeapNumber
// and undefined.
- static Handle<Object> SetValue(Handle<JSObject> holder,
- Handle<ExternalUint16Array> array,
- uint32_t index, Handle<Object> value);
+ static Handle<Object> SetValue(Handle<ExternalUint16Array> array,
+ uint32_t index,
+ Handle<Object> value);
DECLARE_CAST(ExternalUint16Array)
@@ -4771,9 +4771,9 @@
// This accessor applies the correct conversion from Smi, HeapNumber
// and undefined.
- static Handle<Object> SetValue(Handle<JSObject> holder,
- Handle<ExternalInt32Array> array,
- uint32_t index, Handle<Object> value);
+ static Handle<Object> SetValue(Handle<ExternalInt32Array> array,
+ uint32_t index,
+ Handle<Object> value);
DECLARE_CAST(ExternalInt32Array)
@@ -4796,9 +4796,9 @@
// This accessor applies the correct conversion from Smi, HeapNumber
// and undefined.
- static Handle<Object> SetValue(Handle<JSObject> holder,
- Handle<ExternalUint32Array> array,
- uint32_t index, Handle<Object> value);
+ static Handle<Object> SetValue(Handle<ExternalUint32Array> array,
+ uint32_t index,
+ Handle<Object> value);
DECLARE_CAST(ExternalUint32Array)
@@ -4821,9 +4821,9 @@
// This accessor applies the correct conversion from Smi, HeapNumber
// and undefined.
- static Handle<Object> SetValue(Handle<JSObject> holder,
- Handle<ExternalFloat32Array> array,
- uint32_t index, Handle<Object> value);
+ static Handle<Object> SetValue(Handle<ExternalFloat32Array> array,
+ uint32_t index,
+ Handle<Object> value);
DECLARE_CAST(ExternalFloat32Array)
@@ -4846,9 +4846,9 @@
// This accessor applies the correct conversion from Smi, HeapNumber
// and undefined.
- static Handle<Object> SetValue(Handle<JSObject> holder,
- Handle<ExternalFloat64Array> array,
- uint32_t index, Handle<Object> value);
+ static Handle<Object> SetValue(Handle<ExternalFloat64Array> array,
+ uint32_t index,
+ Handle<Object> value);
DECLARE_CAST(ExternalFloat64Array)
@@ -4911,9 +4911,9 @@
// This accessor applies the correct conversion from Smi, HeapNumber
// and undefined.
- static Handle<Object> SetValue(Handle<JSObject> holder,
- Handle<FixedTypedArray<Traits> > array,
- uint32_t index, Handle<Object> value);
+ static Handle<Object> SetValue(Handle<FixedTypedArray<Traits> > array,
+ uint32_t index,
+ Handle<Object> value);
DECLARE_PRINTER(FixedTypedArray)
DECLARE_VERIFIER(FixedTypedArray)
@@ -10234,14 +10234,15 @@
inline bool is_neuterable();
inline void set_is_neuterable(bool value);
- inline bool was_neutered();
- inline void set_was_neutered(bool value);
-
// [weak_next]: linked list of array buffers.
DECL_ACCESSORS(weak_next, Object)
+ // [weak_first_array]: weak linked list of views.
+ DECL_ACCESSORS(weak_first_view, Object)
+
DECLARE_CAST(JSArrayBuffer)
+ // Neutering. Only neuters the buffer, not associated typed arrays.
void Neuter();
// Dispatched behavior.
@@ -10252,18 +10253,18 @@
static const int kByteLengthOffset = kBackingStoreOffset + kPointerSize;
static const int kFlagOffset = kByteLengthOffset + kPointerSize;
static const int kWeakNextOffset = kFlagOffset + kPointerSize;
- static const int kSize = kWeakNextOffset + kPointerSize;
+ static const int kWeakFirstViewOffset = kWeakNextOffset + kPointerSize;
+ static const int kSize = kWeakFirstViewOffset + kPointerSize;
static const int kSizeWithInternalFields =
kSize + v8::ArrayBuffer::kInternalFieldCount * kPointerSize;
+ private:
// Bit position in a flag
static const int kIsExternalBit = 0;
static const int kShouldBeFreed = 1;
static const int kIsNeuterableBit = 2;
- static const int kWasNeuteredBit = 3;
-
- private:
+
DISALLOW_IMPLICIT_CONSTRUCTORS(JSArrayBuffer);
};
@@ -10279,23 +10280,23 @@
// [byte_length]: length of typed array in bytes.
DECL_ACCESSORS(byte_length, Object)
+ // [weak_next]: linked list of typed arrays over the same array buffer.
+ DECL_ACCESSORS(weak_next, Object)
+
DECLARE_CAST(JSArrayBufferView)
DECLARE_VERIFIER(JSArrayBufferView)
-
- inline bool WasNeutered() const;
static const int kBufferOffset = JSObject::kHeaderSize;
static const int kByteOffsetOffset = kBufferOffset + kPointerSize;
static const int kByteLengthOffset = kByteOffsetOffset + kPointerSize;
- static const int kViewSize = kByteLengthOffset + kPointerSize;
-
- private:
-#ifdef VERIFY_HEAP
- DECL_ACCESSORS(raw_byte_offset, Object)
- DECL_ACCESSORS(raw_byte_length, Object)
-#endif
-
+ static const int kWeakNextOffset = kByteLengthOffset + kPointerSize;
+ static const int kViewSize = kWeakNextOffset + kPointerSize;
+
+ protected:
+ void NeuterView();
+
+ private:
DISALLOW_IMPLICIT_CONSTRUCTORS(JSArrayBufferView);
};
@@ -10304,6 +10305,9 @@
public:
// [length]: length of typed array in elements.
DECL_ACCESSORS(length, Object)
+
+ // Neutering. Only neuters this typed array.
+ void Neuter();
DECLARE_CAST(JSTypedArray)
@@ -10325,9 +10329,6 @@
private:
static Handle<JSArrayBuffer> MaterializeArrayBuffer(
Handle<JSTypedArray> typed_array);
-#ifdef VERIFY_HEAP
- DECL_ACCESSORS(raw_length, Object)
-#endif
DISALLOW_IMPLICIT_CONSTRUCTORS(JSTypedArray);
};
@@ -10335,6 +10336,9 @@
class JSDataView: public JSArrayBufferView {
public:
+ // Only neuters this DataView
+ void Neuter();
+
DECLARE_CAST(JSDataView)
// Dispatched behavior.
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698