Index: src/runtime/runtime-typedarray.cc |
diff --git a/src/runtime/runtime-typedarray.cc b/src/runtime/runtime-typedarray.cc |
index 59c417f5b7c92ef548e2370703f94109dc670a66..82224bc9b3e8021d6b780e7af2343f75b9bb65c0 100644 |
--- a/src/runtime/runtime-typedarray.cc |
+++ b/src/runtime/runtime-typedarray.cc |
@@ -88,8 +88,6 @@ bool Runtime::SetupArrayBufferAllocatingData(Isolate* isolate, |
void Runtime::NeuterArrayBuffer(Handle<JSArrayBuffer> array_buffer) { |
Isolate* isolate = array_buffer->GetIsolate(); |
- // Firstly, iterate over the views which are referenced directly by the array |
- // buffer. |
for (Handle<Object> view_obj(array_buffer->weak_first_view(), isolate); |
!view_obj->IsUndefined();) { |
Handle<JSArrayBufferView> view(JSArrayBufferView::cast(*view_obj)); |
@@ -102,24 +100,6 @@ void Runtime::NeuterArrayBuffer(Handle<JSArrayBuffer> array_buffer) { |
} |
view_obj = handle(view->weak_next(), isolate); |
} |
- |
- // Secondly, iterate over the global list of new space views to find views |
- // that belong to the neutered array buffer. |
- Heap* heap = isolate->heap(); |
- for (Handle<Object> view_obj(heap->new_array_buffer_views_list(), isolate); |
- !view_obj->IsUndefined();) { |
- Handle<JSArrayBufferView> view(JSArrayBufferView::cast(*view_obj)); |
- if (view->buffer() == *array_buffer) { |
- if (view->IsJSTypedArray()) { |
- JSTypedArray::cast(*view)->Neuter(); |
- } else if (view->IsJSDataView()) { |
- JSDataView::cast(*view)->Neuter(); |
- } else { |
- UNREACHABLE(); |
- } |
- } |
- view_obj = handle(view->weak_next(), isolate); |
- } |
array_buffer->Neuter(); |
} |
@@ -285,18 +265,11 @@ RUNTIME_FUNCTION(Runtime_TypedArrayInitialize) { |
holder->set_byte_offset(*byte_offset_object); |
holder->set_byte_length(*byte_length_object); |
- Heap* heap = isolate->heap(); |
if (!maybe_buffer->IsNull()) { |
Handle<JSArrayBuffer> buffer = Handle<JSArrayBuffer>::cast(maybe_buffer); |
holder->set_buffer(*buffer); |
- |
- if (heap->InNewSpace(*holder)) { |
- holder->set_weak_next(heap->new_array_buffer_views_list()); |
- heap->set_new_array_buffer_views_list(*holder); |
- } else { |
- holder->set_weak_next(buffer->weak_first_view()); |
- buffer->set_weak_first_view(*holder); |
- } |
+ holder->set_weak_next(buffer->weak_first_view()); |
+ buffer->set_weak_first_view(*holder); |
Handle<ExternalArray> elements = isolate->factory()->NewExternalArray( |
static_cast<int>(length), array_type, |
@@ -394,15 +367,8 @@ RUNTIME_FUNCTION(Runtime_TypedArrayInitializeFromArrayLike) { |
isolate->factory()->NewNumberFromSize(byte_length)); |
holder->set_byte_length(*byte_length_obj); |
holder->set_length(*length_obj); |
- |
- Heap* heap = isolate->heap(); |
- if (heap->InNewSpace(*holder)) { |
- holder->set_weak_next(heap->new_array_buffer_views_list()); |
- heap->set_new_array_buffer_views_list(*holder); |
- } else { |
- holder->set_weak_next(buffer->weak_first_view()); |
- buffer->set_weak_first_view(*holder); |
- } |
+ holder->set_weak_next(buffer->weak_first_view()); |
+ buffer->set_weak_first_view(*holder); |
Handle<ExternalArray> elements = isolate->factory()->NewExternalArray( |
static_cast<int>(length), array_type, |
@@ -576,14 +542,8 @@ RUNTIME_FUNCTION(Runtime_DataViewInitialize) { |
holder->set_byte_offset(*byte_offset); |
holder->set_byte_length(*byte_length); |
- Heap* heap = isolate->heap(); |
- if (heap->InNewSpace(*holder)) { |
- holder->set_weak_next(heap->new_array_buffer_views_list()); |
- heap->set_new_array_buffer_views_list(*holder); |
- } else { |
- holder->set_weak_next(buffer->weak_first_view()); |
- buffer->set_weak_first_view(*holder); |
- } |
+ holder->set_weak_next(buffer->weak_first_view()); |
+ buffer->set_weak_first_view(*holder); |
return isolate->heap()->undefined_value(); |
} |