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 16911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16922 Runtime::SetupArrayBufferAllocatingData(isolate, buffer, | 16922 Runtime::SetupArrayBufferAllocatingData(isolate, buffer, |
16923 fixed_typed_array->DataSize(), false); | 16923 fixed_typed_array->DataSize(), false); |
16924 memcpy(buffer->backing_store(), | 16924 memcpy(buffer->backing_store(), |
16925 fixed_typed_array->DataPtr(), | 16925 fixed_typed_array->DataPtr(), |
16926 fixed_typed_array->DataSize()); | 16926 fixed_typed_array->DataSize()); |
16927 Handle<ExternalArray> new_elements = | 16927 Handle<ExternalArray> new_elements = |
16928 isolate->factory()->NewExternalArray( | 16928 isolate->factory()->NewExternalArray( |
16929 fixed_typed_array->length(), typed_array->type(), | 16929 fixed_typed_array->length(), typed_array->type(), |
16930 static_cast<uint8_t*>(buffer->backing_store())); | 16930 static_cast<uint8_t*>(buffer->backing_store())); |
16931 | 16931 |
16932 Heap* heap = isolate->heap(); | 16932 buffer->set_weak_first_view(*typed_array); |
16933 if (heap->InNewSpace(*typed_array)) { | 16933 DCHECK(typed_array->weak_next() == isolate->heap()->undefined_value()); |
16934 DCHECK(typed_array->weak_next() == isolate->heap()->undefined_value()); | |
16935 typed_array->set_weak_next(heap->new_array_buffer_views_list()); | |
16936 heap->set_new_array_buffer_views_list(*typed_array); | |
16937 } else { | |
16938 buffer->set_weak_first_view(*typed_array); | |
16939 DCHECK(typed_array->weak_next() == isolate->heap()->undefined_value()); | |
16940 } | |
16941 typed_array->set_buffer(*buffer); | 16934 typed_array->set_buffer(*buffer); |
16942 JSObject::SetMapAndElements(typed_array, new_map, new_elements); | 16935 JSObject::SetMapAndElements(typed_array, new_map, new_elements); |
16943 | 16936 |
16944 return buffer; | 16937 return buffer; |
16945 } | 16938 } |
16946 | 16939 |
16947 | 16940 |
16948 Handle<JSArrayBuffer> JSTypedArray::GetBuffer() { | 16941 Handle<JSArrayBuffer> JSTypedArray::GetBuffer() { |
16949 Handle<Object> result(buffer(), GetIsolate()); | 16942 Handle<Object> result(buffer(), GetIsolate()); |
16950 if (*result != Smi::FromInt(0)) { | 16943 if (*result != Smi::FromInt(0)) { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17014 CompilationInfo* info) { | 17007 CompilationInfo* info) { |
17015 Handle<DependentCode> codes = DependentCode::InsertCompilationInfo( | 17008 Handle<DependentCode> codes = DependentCode::InsertCompilationInfo( |
17016 handle(cell->dependent_code(), info->isolate()), | 17009 handle(cell->dependent_code(), info->isolate()), |
17017 DependentCode::kPropertyCellChangedGroup, info->object_wrapper()); | 17010 DependentCode::kPropertyCellChangedGroup, info->object_wrapper()); |
17018 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); | 17011 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); |
17019 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( | 17012 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( |
17020 cell, info->zone()); | 17013 cell, info->zone()); |
17021 } | 17014 } |
17022 | 17015 |
17023 } } // namespace v8::internal | 17016 } } // namespace v8::internal |
OLD | NEW |