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 16463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16474 FixedToExternalElementsKind(map->elements_kind())); | 16474 FixedToExternalElementsKind(map->elements_kind())); |
16475 | 16475 |
16476 Handle<FixedTypedArrayBase> fixed_typed_array( | 16476 Handle<FixedTypedArrayBase> fixed_typed_array( |
16477 FixedTypedArrayBase::cast(typed_array->elements())); | 16477 FixedTypedArrayBase::cast(typed_array->elements())); |
16478 | 16478 |
16479 Handle<JSArrayBuffer> buffer(JSArrayBuffer::cast(typed_array->buffer()), | 16479 Handle<JSArrayBuffer> buffer(JSArrayBuffer::cast(typed_array->buffer()), |
16480 isolate); | 16480 isolate); |
16481 void* backing_store = | 16481 void* backing_store = |
16482 isolate->array_buffer_allocator()->AllocateUninitialized( | 16482 isolate->array_buffer_allocator()->AllocateUninitialized( |
16483 fixed_typed_array->DataSize()); | 16483 fixed_typed_array->DataSize()); |
16484 isolate->heap()->RegisterNewArrayBuffer(isolate->heap()->InNewSpace(*buffer), | 16484 isolate->heap()->RegisterNewArrayBuffer(backing_store, |
16485 backing_store, | |
16486 fixed_typed_array->DataSize()); | 16485 fixed_typed_array->DataSize()); |
16487 buffer->set_backing_store(backing_store); | 16486 buffer->set_backing_store(backing_store); |
16488 buffer->set_is_external(false); | 16487 buffer->set_is_external(false); |
16489 memcpy(buffer->backing_store(), | 16488 memcpy(buffer->backing_store(), |
16490 fixed_typed_array->DataPtr(), | 16489 fixed_typed_array->DataPtr(), |
16491 fixed_typed_array->DataSize()); | 16490 fixed_typed_array->DataSize()); |
16492 Handle<ExternalArray> new_elements = | 16491 Handle<ExternalArray> new_elements = |
16493 isolate->factory()->NewExternalArray( | 16492 isolate->factory()->NewExternalArray( |
16494 fixed_typed_array->length(), typed_array->type(), | 16493 fixed_typed_array->length(), typed_array->type(), |
16495 static_cast<uint8_t*>(buffer->backing_store())); | 16494 static_cast<uint8_t*>(buffer->backing_store())); |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16638 Handle<Object> new_value) { | 16637 Handle<Object> new_value) { |
16639 if (cell->value() != *new_value) { | 16638 if (cell->value() != *new_value) { |
16640 cell->set_value(*new_value); | 16639 cell->set_value(*new_value); |
16641 Isolate* isolate = cell->GetIsolate(); | 16640 Isolate* isolate = cell->GetIsolate(); |
16642 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 16641 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
16643 isolate, DependentCode::kPropertyCellChangedGroup); | 16642 isolate, DependentCode::kPropertyCellChangedGroup); |
16644 } | 16643 } |
16645 } | 16644 } |
16646 } // namespace internal | 16645 } // namespace internal |
16647 } // namespace v8 | 16646 } // namespace v8 |
OLD | NEW |