Index: src/runtime/runtime-typedarray.cc |
diff --git a/src/runtime/runtime-typedarray.cc b/src/runtime/runtime-typedarray.cc |
index a92a642bbc936cb8129386ef692acf73324060e7..ba676b54fdbf523b3468f089c4e80312d5857c56 100644 |
--- a/src/runtime/runtime-typedarray.cc |
+++ b/src/runtime/runtime-typedarray.cc |
@@ -16,7 +16,7 @@ |
void Runtime::SetupArrayBuffer(Isolate* isolate, |
Handle<JSArrayBuffer> array_buffer, |
bool is_external, void* data, |
- size_t allocated_length, SharedFlag shared) { |
+ size_t allocated_length) { |
DCHECK(array_buffer->GetInternalFieldCount() == |
v8::ArrayBuffer::kInternalFieldCount); |
for (int i = 0; i < v8::ArrayBuffer::kInternalFieldCount; i++) { |
@@ -25,8 +25,7 @@ |
array_buffer->set_backing_store(data); |
array_buffer->set_bit_field(0); |
array_buffer->set_is_external(is_external); |
- array_buffer->set_is_neuterable(shared == SharedFlag::kNotShared); |
- array_buffer->set_is_shared(shared == SharedFlag::kShared); |
+ array_buffer->set_is_neuterable(true); |
Handle<Object> byte_length = |
isolate->factory()->NewNumberFromSize(allocated_length); |
@@ -42,8 +41,7 @@ |
bool Runtime::SetupArrayBufferAllocatingData(Isolate* isolate, |
Handle<JSArrayBuffer> array_buffer, |
size_t allocated_length, |
- bool initialize, |
- SharedFlag shared) { |
+ bool initialize) { |
void* data; |
CHECK(isolate->array_buffer_allocator() != NULL); |
// Prevent creating array buffers when serializing. |
@@ -60,8 +58,7 @@ |
data = NULL; |
} |
- SetupArrayBuffer(isolate, array_buffer, false, data, allocated_length, |
- shared); |
+ SetupArrayBuffer(isolate, array_buffer, false, data, allocated_length); |
return true; |
} |
@@ -73,10 +70,9 @@ |
RUNTIME_FUNCTION(Runtime_ArrayBufferInitialize) { |
HandleScope scope(isolate); |
- DCHECK(args.length() == 3); |
+ DCHECK(args.length() == 2); |
CONVERT_ARG_HANDLE_CHECKED(JSArrayBuffer, holder, 0); |
CONVERT_NUMBER_ARG_HANDLE_CHECKED(byteLength, 1); |
- CONVERT_BOOLEAN_ARG_CHECKED(is_shared, 2); |
if (!holder->byte_length()->IsUndefined()) { |
// ArrayBuffer is already initialized; probably a fuzz test. |
return *holder; |
@@ -86,9 +82,8 @@ |
THROW_NEW_ERROR_RETURN_FAILURE( |
isolate, NewRangeError(MessageTemplate::kInvalidArrayBufferLength)); |
} |
- if (!Runtime::SetupArrayBufferAllocatingData( |
- isolate, holder, allocated_length, true, |
- is_shared ? SharedFlag::kShared : SharedFlag::kNotShared)) { |
+ if (!Runtime::SetupArrayBufferAllocatingData(isolate, holder, |
+ allocated_length)) { |
THROW_NEW_ERROR_RETURN_FAILURE( |
isolate, NewRangeError(MessageTemplate::kInvalidArrayBufferLength)); |
} |
@@ -143,8 +138,6 @@ |
CHECK(Smi::FromInt(0) == array_buffer->byte_length()); |
return isolate->heap()->undefined_value(); |
} |
- // Shared array buffers should never be neutered. |
- DCHECK(!array_buffer->is_shared()); |
DCHECK(!array_buffer->is_external()); |
void* backing_store = array_buffer->backing_store(); |
size_t byte_length = NumberToSize(isolate, array_buffer->byte_length()); |
@@ -247,8 +240,7 @@ |
DCHECK(IsExternalArrayElementsKind(holder->map()->elements_kind())); |
} else { |
Handle<JSArrayBuffer> buffer = isolate->factory()->NewJSArrayBuffer(); |
- Runtime::SetupArrayBuffer(isolate, buffer, true, NULL, byte_length, |
- SharedFlag::kNotShared); |
+ Runtime::SetupArrayBuffer(isolate, buffer, true, NULL, byte_length); |
holder->set_buffer(*buffer); |
Handle<FixedTypedArrayBase> elements = |
isolate->factory()->NewFixedTypedArray(static_cast<int>(length), |