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

Unified Diff: src/runtime/runtime-typedarray.cc

Issue 929973002: Revert "Fix JSArrayBufferView visitor template to fix ARM build." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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/objects.cc ('k') | src/serialize.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « src/objects.cc ('k') | src/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698