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