Index: src/factory.cc |
diff --git a/src/factory.cc b/src/factory.cc |
index ef695cf337d0acfddda343be09407b9df19f43b4..4063512e28cdf2c3f0c6baee630ddf2c9af7e6d0 100644 |
--- a/src/factory.cc |
+++ b/src/factory.cc |
@@ -1796,8 +1796,14 @@ void SetupArrayBufferView(i::Isolate* isolate, |
obj->set_buffer(*buffer); |
- obj->set_weak_next(buffer->weak_first_view()); |
- buffer->set_weak_first_view(*obj); |
+ Heap* heap = isolate->heap(); |
+ if (heap->InNewSpace(*obj)) { |
+ obj->set_weak_next(heap->new_array_buffer_views_list()); |
+ heap->set_new_array_buffer_views_list(*obj); |
+ } else { |
+ obj->set_weak_next(buffer->weak_first_view()); |
+ buffer->set_weak_first_view(*obj); |
+ } |
i::Handle<i::Object> byte_offset_object = |
isolate->factory()->NewNumberFromSize(byte_offset); |