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

Unified Diff: src/objects.h

Issue 1107843002: Reland "Remove the weak list of views from array buffers" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: use bounds check 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/ic/ic.cc ('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 bfec7726786dabf54fdf89f122988b02df40f7f3..68db075981513de26558e03cc12017748c9d32f4 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -4660,9 +4660,9 @@ class ExternalUint8ClampedArray: public ExternalArray {
// 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<ExternalUint8ClampedArray> array,
- uint32_t index,
- Handle<Object> value);
+ static Handle<Object> SetValue(Handle<JSObject> holder,
+ Handle<ExternalUint8ClampedArray> array,
+ uint32_t index, Handle<Object> value);
DECLARE_CAST(ExternalUint8ClampedArray)
@@ -4684,9 +4684,9 @@ class ExternalInt8Array: public ExternalArray {
// This accessor applies the correct conversion from Smi, HeapNumber
// and undefined.
- static Handle<Object> SetValue(Handle<ExternalInt8Array> array,
- uint32_t index,
- Handle<Object> value);
+ static Handle<Object> SetValue(Handle<JSObject> holder,
+ Handle<ExternalInt8Array> array,
+ uint32_t index, Handle<Object> value);
DECLARE_CAST(ExternalInt8Array)
@@ -4708,9 +4708,9 @@ class ExternalUint8Array: public ExternalArray {
// This accessor applies the correct conversion from Smi, HeapNumber
// and undefined.
- static Handle<Object> SetValue(Handle<ExternalUint8Array> array,
- uint32_t index,
- Handle<Object> value);
+ static Handle<Object> SetValue(Handle<JSObject> holder,
+ Handle<ExternalUint8Array> array,
+ uint32_t index, Handle<Object> value);
DECLARE_CAST(ExternalUint8Array)
@@ -4732,9 +4732,9 @@ class ExternalInt16Array: public ExternalArray {
// This accessor applies the correct conversion from Smi, HeapNumber
// and undefined.
- static Handle<Object> SetValue(Handle<ExternalInt16Array> array,
- uint32_t index,
- Handle<Object> value);
+ static Handle<Object> SetValue(Handle<JSObject> holder,
+ Handle<ExternalInt16Array> array,
+ uint32_t index, Handle<Object> value);
DECLARE_CAST(ExternalInt16Array)
@@ -4757,9 +4757,9 @@ class ExternalUint16Array: public ExternalArray {
// This accessor applies the correct conversion from Smi, HeapNumber
// and undefined.
- static Handle<Object> SetValue(Handle<ExternalUint16Array> array,
- uint32_t index,
- Handle<Object> value);
+ static Handle<Object> SetValue(Handle<JSObject> holder,
+ Handle<ExternalUint16Array> array,
+ uint32_t index, Handle<Object> value);
DECLARE_CAST(ExternalUint16Array)
@@ -4781,9 +4781,9 @@ class ExternalInt32Array: public ExternalArray {
// This accessor applies the correct conversion from Smi, HeapNumber
// and undefined.
- static Handle<Object> SetValue(Handle<ExternalInt32Array> array,
- uint32_t index,
- Handle<Object> value);
+ static Handle<Object> SetValue(Handle<JSObject> holder,
+ Handle<ExternalInt32Array> array,
+ uint32_t index, Handle<Object> value);
DECLARE_CAST(ExternalInt32Array)
@@ -4806,9 +4806,9 @@ class ExternalUint32Array: public ExternalArray {
// This accessor applies the correct conversion from Smi, HeapNumber
// and undefined.
- static Handle<Object> SetValue(Handle<ExternalUint32Array> array,
- uint32_t index,
- Handle<Object> value);
+ static Handle<Object> SetValue(Handle<JSObject> holder,
+ Handle<ExternalUint32Array> array,
+ uint32_t index, Handle<Object> value);
DECLARE_CAST(ExternalUint32Array)
@@ -4831,9 +4831,9 @@ class ExternalFloat32Array: public ExternalArray {
// This accessor applies the correct conversion from Smi, HeapNumber
// and undefined.
- static Handle<Object> SetValue(Handle<ExternalFloat32Array> array,
- uint32_t index,
- Handle<Object> value);
+ static Handle<Object> SetValue(Handle<JSObject> holder,
+ Handle<ExternalFloat32Array> array,
+ uint32_t index, Handle<Object> value);
DECLARE_CAST(ExternalFloat32Array)
@@ -4856,9 +4856,9 @@ class ExternalFloat64Array: public ExternalArray {
// This accessor applies the correct conversion from Smi, HeapNumber
// and undefined.
- static Handle<Object> SetValue(Handle<ExternalFloat64Array> array,
- uint32_t index,
- Handle<Object> value);
+ static Handle<Object> SetValue(Handle<JSObject> holder,
+ Handle<ExternalFloat64Array> array,
+ uint32_t index, Handle<Object> value);
DECLARE_CAST(ExternalFloat64Array)
@@ -4921,9 +4921,9 @@ class FixedTypedArray: public FixedTypedArrayBase {
// This accessor applies the correct conversion from Smi, HeapNumber
// and undefined.
- static Handle<Object> SetValue(Handle<FixedTypedArray<Traits> > array,
- uint32_t index,
- Handle<Object> value);
+ static Handle<Object> SetValue(Handle<JSObject> holder,
+ Handle<FixedTypedArray<Traits> > array,
+ uint32_t index, Handle<Object> value);
DECLARE_PRINTER(FixedTypedArray)
DECLARE_VERIFIER(FixedTypedArray)
@@ -10244,15 +10244,14 @@ class JSArrayBuffer: public JSObject {
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.
@@ -10263,18 +10262,18 @@ class JSArrayBuffer: public JSObject {
static const int kByteLengthOffset = kBackingStoreOffset + kPointerSize;
static const int kFlagOffset = kByteLengthOffset + kPointerSize;
static const int kWeakNextOffset = kFlagOffset + kPointerSize;
- static const int kWeakFirstViewOffset = kWeakNextOffset + kPointerSize;
- static const int kSize = kWeakFirstViewOffset + kPointerSize;
+ static const int kSize = kWeakNextOffset + 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);
};
@@ -10290,23 +10289,23 @@ class JSArrayBufferView: public JSObject {
// [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 kWeakNextOffset = kByteLengthOffset + kPointerSize;
- static const int kViewSize = kWeakNextOffset + kPointerSize;
-
- protected:
- void NeuterView();
+ static const int kViewSize = kByteLengthOffset + kPointerSize;
private:
+#ifdef VERIFY_HEAP
+ DECL_ACCESSORS(raw_byte_offset, Object)
+ DECL_ACCESSORS(raw_byte_length, Object)
+#endif
+
DISALLOW_IMPLICIT_CONSTRUCTORS(JSArrayBufferView);
};
@@ -10316,9 +10315,6 @@ class JSTypedArray: public JSArrayBufferView {
// [length]: length of typed array in elements.
DECL_ACCESSORS(length, Object)
- // Neutering. Only neuters this typed array.
- void Neuter();
-
DECLARE_CAST(JSTypedArray)
ExternalArrayType type();
@@ -10339,6 +10335,9 @@ class JSTypedArray: public JSArrayBufferView {
private:
static Handle<JSArrayBuffer> MaterializeArrayBuffer(
Handle<JSTypedArray> typed_array);
+#ifdef VERIFY_HEAP
+ DECL_ACCESSORS(raw_length, Object)
+#endif
DISALLOW_IMPLICIT_CONSTRUCTORS(JSTypedArray);
};
@@ -10346,9 +10345,6 @@ class JSTypedArray: public JSArrayBufferView {
class JSDataView: public JSArrayBufferView {
public:
- // Only neuters this DataView
- void Neuter();
-
DECLARE_CAST(JSDataView)
// Dispatched behavior.
« no previous file with comments | « src/ic/ic.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698