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

Side by Side Diff: src/objects.cc

Issue 1133773002: Keep track of array buffers in new space separately (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 7 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
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 17064 matching lines...) Expand 10 before | Expand all | Expand 10 after
17075 FixedToExternalElementsKind(map->elements_kind())); 17075 FixedToExternalElementsKind(map->elements_kind()));
17076 17076
17077 Handle<FixedTypedArrayBase> fixed_typed_array( 17077 Handle<FixedTypedArrayBase> fixed_typed_array(
17078 FixedTypedArrayBase::cast(typed_array->elements())); 17078 FixedTypedArrayBase::cast(typed_array->elements()));
17079 17079
17080 Handle<JSArrayBuffer> buffer(JSArrayBuffer::cast(typed_array->buffer()), 17080 Handle<JSArrayBuffer> buffer(JSArrayBuffer::cast(typed_array->buffer()),
17081 isolate); 17081 isolate);
17082 void* backing_store = 17082 void* backing_store =
17083 isolate->array_buffer_allocator()->AllocateUninitialized( 17083 isolate->array_buffer_allocator()->AllocateUninitialized(
17084 fixed_typed_array->DataSize()); 17084 fixed_typed_array->DataSize());
17085 isolate->heap()->RegisterNewArrayBuffer(backing_store, 17085 isolate->heap()->RegisterNewArrayBuffer(isolate->heap()->InNewSpace(*buffer),
17086 backing_store,
17086 fixed_typed_array->DataSize()); 17087 fixed_typed_array->DataSize());
17087 buffer->set_backing_store(backing_store); 17088 buffer->set_backing_store(backing_store);
17088 buffer->set_is_external(false); 17089 buffer->set_is_external(false);
17089 memcpy(buffer->backing_store(), 17090 memcpy(buffer->backing_store(),
17090 fixed_typed_array->DataPtr(), 17091 fixed_typed_array->DataPtr(),
17091 fixed_typed_array->DataSize()); 17092 fixed_typed_array->DataSize());
17092 Handle<ExternalArray> new_elements = 17093 Handle<ExternalArray> new_elements =
17093 isolate->factory()->NewExternalArray( 17094 isolate->factory()->NewExternalArray(
17094 fixed_typed_array->length(), typed_array->type(), 17095 fixed_typed_array->length(), typed_array->type(),
17095 static_cast<uint8_t*>(buffer->backing_store())); 17096 static_cast<uint8_t*>(buffer->backing_store()));
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
17237 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell, 17238 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell,
17238 Handle<Object> new_value) { 17239 Handle<Object> new_value) {
17239 if (cell->value() != *new_value) { 17240 if (cell->value() != *new_value) {
17240 cell->set_value(*new_value); 17241 cell->set_value(*new_value);
17241 Isolate* isolate = cell->GetIsolate(); 17242 Isolate* isolate = cell->GetIsolate();
17242 cell->dependent_code()->DeoptimizeDependentCodeGroup( 17243 cell->dependent_code()->DeoptimizeDependentCodeGroup(
17243 isolate, DependentCode::kPropertyCellChangedGroup); 17244 isolate, DependentCode::kPropertyCellChangedGroup);
17244 } 17245 }
17245 } 17246 }
17246 } } // namespace v8::internal 17247 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698