| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <sstream> | 5 #include <sstream> |
| 6 | 6 |
| 7 #include "src/v8.h" | 7 #include "src/v8.h" |
| 8 | 8 |
| 9 #include "src/accessors.h" | 9 #include "src/accessors.h" |
| 10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
| (...skipping 16865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16876 Runtime::SetupArrayBufferAllocatingData(isolate, buffer, | 16876 Runtime::SetupArrayBufferAllocatingData(isolate, buffer, |
| 16877 fixed_typed_array->DataSize(), false); | 16877 fixed_typed_array->DataSize(), false); |
| 16878 memcpy(buffer->backing_store(), | 16878 memcpy(buffer->backing_store(), |
| 16879 fixed_typed_array->DataPtr(), | 16879 fixed_typed_array->DataPtr(), |
| 16880 fixed_typed_array->DataSize()); | 16880 fixed_typed_array->DataSize()); |
| 16881 Handle<ExternalArray> new_elements = | 16881 Handle<ExternalArray> new_elements = |
| 16882 isolate->factory()->NewExternalArray( | 16882 isolate->factory()->NewExternalArray( |
| 16883 fixed_typed_array->length(), typed_array->type(), | 16883 fixed_typed_array->length(), typed_array->type(), |
| 16884 static_cast<uint8_t*>(buffer->backing_store())); | 16884 static_cast<uint8_t*>(buffer->backing_store())); |
| 16885 | 16885 |
| 16886 Heap* heap = isolate->heap(); | 16886 buffer->set_weak_first_view(*typed_array); |
| 16887 if (heap->InNewSpace(*typed_array)) { | 16887 DCHECK(typed_array->weak_next() == isolate->heap()->undefined_value()); |
| 16888 DCHECK(typed_array->weak_next() == isolate->heap()->undefined_value()); | |
| 16889 typed_array->set_weak_next(heap->new_array_buffer_views_list()); | |
| 16890 heap->set_new_array_buffer_views_list(*typed_array); | |
| 16891 } else { | |
| 16892 buffer->set_weak_first_view(*typed_array); | |
| 16893 DCHECK(typed_array->weak_next() == isolate->heap()->undefined_value()); | |
| 16894 } | |
| 16895 typed_array->set_buffer(*buffer); | 16888 typed_array->set_buffer(*buffer); |
| 16896 JSObject::SetMapAndElements(typed_array, new_map, new_elements); | 16889 JSObject::SetMapAndElements(typed_array, new_map, new_elements); |
| 16897 | 16890 |
| 16898 return buffer; | 16891 return buffer; |
| 16899 } | 16892 } |
| 16900 | 16893 |
| 16901 | 16894 |
| 16902 Handle<JSArrayBuffer> JSTypedArray::GetBuffer() { | 16895 Handle<JSArrayBuffer> JSTypedArray::GetBuffer() { |
| 16903 Handle<Object> result(buffer(), GetIsolate()); | 16896 Handle<Object> result(buffer(), GetIsolate()); |
| 16904 if (*result != Smi::FromInt(0)) { | 16897 if (*result != Smi::FromInt(0)) { |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16967 Handle<DependentCode> codes = | 16960 Handle<DependentCode> codes = |
| 16968 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), | 16961 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), |
| 16969 DependentCode::kPropertyCellChangedGroup, | 16962 DependentCode::kPropertyCellChangedGroup, |
| 16970 info->object_wrapper()); | 16963 info->object_wrapper()); |
| 16971 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); | 16964 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); |
| 16972 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( | 16965 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( |
| 16973 cell, info->zone()); | 16966 cell, info->zone()); |
| 16974 } | 16967 } |
| 16975 | 16968 |
| 16976 } } // namespace v8::internal | 16969 } } // namespace v8::internal |
| OLD | NEW |