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 <iomanip> | 5 #include <iomanip> |
6 #include <sstream> | 6 #include <sstream> |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
(...skipping 16452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16463 FixedToExternalElementsKind(map->elements_kind())); | 16463 FixedToExternalElementsKind(map->elements_kind())); |
16464 | 16464 |
16465 Handle<FixedTypedArrayBase> fixed_typed_array( | 16465 Handle<FixedTypedArrayBase> fixed_typed_array( |
16466 FixedTypedArrayBase::cast(typed_array->elements())); | 16466 FixedTypedArrayBase::cast(typed_array->elements())); |
16467 | 16467 |
16468 Handle<JSArrayBuffer> buffer(JSArrayBuffer::cast(typed_array->buffer()), | 16468 Handle<JSArrayBuffer> buffer(JSArrayBuffer::cast(typed_array->buffer()), |
16469 isolate); | 16469 isolate); |
16470 void* backing_store = | 16470 void* backing_store = |
16471 isolate->array_buffer_allocator()->AllocateUninitialized( | 16471 isolate->array_buffer_allocator()->AllocateUninitialized( |
16472 fixed_typed_array->DataSize()); | 16472 fixed_typed_array->DataSize()); |
16473 isolate->heap()->RegisterNewArrayBuffer(backing_store, | |
16474 fixed_typed_array->DataSize()); | |
16475 buffer->set_backing_store(backing_store); | 16473 buffer->set_backing_store(backing_store); |
16476 buffer->set_is_external(false); | 16474 buffer->set_is_external(false); |
| 16475 isolate->heap()->RegisterNewArrayBuffer(isolate->heap()->InNewSpace(*buffer), |
| 16476 backing_store, |
| 16477 fixed_typed_array->DataSize()); |
16477 memcpy(buffer->backing_store(), | 16478 memcpy(buffer->backing_store(), |
16478 fixed_typed_array->DataPtr(), | 16479 fixed_typed_array->DataPtr(), |
16479 fixed_typed_array->DataSize()); | 16480 fixed_typed_array->DataSize()); |
16480 Handle<ExternalArray> new_elements = | 16481 Handle<ExternalArray> new_elements = |
16481 isolate->factory()->NewExternalArray( | 16482 isolate->factory()->NewExternalArray( |
16482 fixed_typed_array->length(), typed_array->type(), | 16483 fixed_typed_array->length(), typed_array->type(), |
16483 static_cast<uint8_t*>(buffer->backing_store())); | 16484 static_cast<uint8_t*>(buffer->backing_store())); |
16484 | 16485 |
16485 JSObject::SetMapAndElements(typed_array, new_map, new_elements); | 16486 JSObject::SetMapAndElements(typed_array, new_map, new_elements); |
16486 | 16487 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16626 Handle<Object> new_value) { | 16627 Handle<Object> new_value) { |
16627 if (cell->value() != *new_value) { | 16628 if (cell->value() != *new_value) { |
16628 cell->set_value(*new_value); | 16629 cell->set_value(*new_value); |
16629 Isolate* isolate = cell->GetIsolate(); | 16630 Isolate* isolate = cell->GetIsolate(); |
16630 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 16631 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
16631 isolate, DependentCode::kPropertyCellChangedGroup); | 16632 isolate, DependentCode::kPropertyCellChangedGroup); |
16632 } | 16633 } |
16633 } | 16634 } |
16634 } // namespace internal | 16635 } // namespace internal |
16635 } // namespace v8 | 16636 } // namespace v8 |
OLD | NEW |