Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/objects.cc

Issue 1177083003: Reland "Keep track of array buffers in new space separately" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/objects-visiting-inl.h ('k') | src/runtime/runtime-typedarray.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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(backing_store, 16484 isolate->heap()->RegisterNewArrayBuffer(isolate->heap()->InNewSpace(*buffer),
16485 backing_store,
16485 fixed_typed_array->DataSize()); 16486 fixed_typed_array->DataSize());
16486 buffer->set_backing_store(backing_store); 16487 buffer->set_backing_store(backing_store);
16487 buffer->set_is_external(false); 16488 buffer->set_is_external(false);
16488 memcpy(buffer->backing_store(), 16489 memcpy(buffer->backing_store(),
16489 fixed_typed_array->DataPtr(), 16490 fixed_typed_array->DataPtr(),
16490 fixed_typed_array->DataSize()); 16491 fixed_typed_array->DataSize());
16491 Handle<ExternalArray> new_elements = 16492 Handle<ExternalArray> new_elements =
16492 isolate->factory()->NewExternalArray( 16493 isolate->factory()->NewExternalArray(
16493 fixed_typed_array->length(), typed_array->type(), 16494 fixed_typed_array->length(), typed_array->type(),
16494 static_cast<uint8_t*>(buffer->backing_store())); 16495 static_cast<uint8_t*>(buffer->backing_store()));
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
16637 Handle<Object> new_value) { 16638 Handle<Object> new_value) {
16638 if (cell->value() != *new_value) { 16639 if (cell->value() != *new_value) {
16639 cell->set_value(*new_value); 16640 cell->set_value(*new_value);
16640 Isolate* isolate = cell->GetIsolate(); 16641 Isolate* isolate = cell->GetIsolate();
16641 cell->dependent_code()->DeoptimizeDependentCodeGroup( 16642 cell->dependent_code()->DeoptimizeDependentCodeGroup(
16642 isolate, DependentCode::kPropertyCellChangedGroup); 16643 isolate, DependentCode::kPropertyCellChangedGroup);
16643 } 16644 }
16644 } 16645 }
16645 } // namespace internal 16646 } // namespace internal
16646 } // namespace v8 16647 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/objects-visiting-inl.h ('k') | src/runtime/runtime-typedarray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698