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

Side by Side Diff: src/objects.cc

Issue 1069883002: WIP SharedArrayBuffer implementation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: update MakeTypeError calls Created 5 years, 8 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 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after
1580 case JS_OBJECT_TYPE: 1580 case JS_OBJECT_TYPE:
1581 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: 1581 case JS_CONTEXT_EXTENSION_OBJECT_TYPE:
1582 case JS_GENERATOR_OBJECT_TYPE: 1582 case JS_GENERATOR_OBJECT_TYPE:
1583 case JS_MODULE_TYPE: 1583 case JS_MODULE_TYPE:
1584 case JS_VALUE_TYPE: 1584 case JS_VALUE_TYPE:
1585 case JS_DATE_TYPE: 1585 case JS_DATE_TYPE:
1586 case JS_ARRAY_TYPE: 1586 case JS_ARRAY_TYPE:
1587 case JS_ARRAY_BUFFER_TYPE: 1587 case JS_ARRAY_BUFFER_TYPE:
1588 case JS_TYPED_ARRAY_TYPE: 1588 case JS_TYPED_ARRAY_TYPE:
1589 case JS_DATA_VIEW_TYPE: 1589 case JS_DATA_VIEW_TYPE:
1590 case JS_SHARED_ARRAY_BUFFER_TYPE:
1591 case JS_SHARED_TYPED_ARRAY_TYPE:
1590 case JS_SET_TYPE: 1592 case JS_SET_TYPE:
1591 case JS_MAP_TYPE: 1593 case JS_MAP_TYPE:
1592 case JS_SET_ITERATOR_TYPE: 1594 case JS_SET_ITERATOR_TYPE:
1593 case JS_MAP_ITERATOR_TYPE: 1595 case JS_MAP_ITERATOR_TYPE:
1594 case JS_WEAK_MAP_TYPE: 1596 case JS_WEAK_MAP_TYPE:
1595 case JS_WEAK_SET_TYPE: 1597 case JS_WEAK_SET_TYPE:
1596 case JS_REGEXP_TYPE: 1598 case JS_REGEXP_TYPE:
1597 case JS_GLOBAL_PROXY_TYPE: 1599 case JS_GLOBAL_PROXY_TYPE:
1598 case JS_GLOBAL_OBJECT_TYPE: 1600 case JS_GLOBAL_OBJECT_TYPE:
1599 case JS_BUILTINS_OBJECT_TYPE: 1601 case JS_BUILTINS_OBJECT_TYPE:
(...skipping 15422 matching lines...) Expand 10 before | Expand all | Expand 10 after
17022 17024
17023 Handle<Map> map(typed_array->map()); 17025 Handle<Map> map(typed_array->map());
17024 Isolate* isolate = typed_array->GetIsolate(); 17026 Isolate* isolate = typed_array->GetIsolate();
17025 17027
17026 DCHECK(IsFixedTypedArrayElementsKind(map->elements_kind())); 17028 DCHECK(IsFixedTypedArrayElementsKind(map->elements_kind()));
17027 17029
17028 Handle<Map> new_map = Map::TransitionElementsTo( 17030 Handle<Map> new_map = Map::TransitionElementsTo(
17029 map, 17031 map,
17030 FixedToExternalElementsKind(map->elements_kind())); 17032 FixedToExternalElementsKind(map->elements_kind()));
17031 17033
17032 Handle<JSArrayBuffer> buffer = isolate->factory()->NewJSArrayBuffer(); 17034 Handle<JSArrayBuffer> buffer =
17035 isolate->factory()->NewJSArrayBuffer(typed_array->is_shared());
17033 Handle<FixedTypedArrayBase> fixed_typed_array( 17036 Handle<FixedTypedArrayBase> fixed_typed_array(
17034 FixedTypedArrayBase::cast(typed_array->elements())); 17037 FixedTypedArrayBase::cast(typed_array->elements()));
17035 Runtime::SetupArrayBufferAllocatingData(isolate, buffer, 17038 Runtime::SetupArrayBufferAllocatingData(isolate, buffer,
17036 fixed_typed_array->DataSize(), false); 17039 fixed_typed_array->DataSize(), false);
17037 memcpy(buffer->backing_store(), 17040 memcpy(buffer->backing_store(),
17038 fixed_typed_array->DataPtr(), 17041 fixed_typed_array->DataPtr(),
17039 fixed_typed_array->DataSize()); 17042 fixed_typed_array->DataSize());
17040 Handle<ExternalArray> new_elements = 17043 Handle<ExternalArray> new_elements =
17041 isolate->factory()->NewExternalArray( 17044 isolate->factory()->NewExternalArray(
17042 fixed_typed_array->length(), typed_array->type(), 17045 fixed_typed_array->length(), typed_array->type(),
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
17201 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell, 17204 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell,
17202 Handle<Object> new_value) { 17205 Handle<Object> new_value) {
17203 if (cell->value() != *new_value) { 17206 if (cell->value() != *new_value) {
17204 cell->set_value(*new_value); 17207 cell->set_value(*new_value);
17205 Isolate* isolate = cell->GetIsolate(); 17208 Isolate* isolate = cell->GetIsolate();
17206 cell->dependent_code()->DeoptimizeDependentCodeGroup( 17209 cell->dependent_code()->DeoptimizeDependentCodeGroup(
17207 isolate, DependentCode::kPropertyCellChangedGroup); 17210 isolate, DependentCode::kPropertyCellChangedGroup);
17208 } 17211 }
17209 } 17212 }
17210 } } // namespace v8::internal 17213 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698