Index: src/factory.cc |
diff --git a/src/factory.cc b/src/factory.cc |
index e25e6c2c3584a0a8fcfe9c1f4c8df1cabc7ec7f2..59ab64dbe5d723516e5e13a0f6ecff6005adccfc 100644 |
--- a/src/factory.cc |
+++ b/src/factory.cc |
@@ -1717,9 +1717,11 @@ Handle<JSGeneratorObject> Factory::NewJSGeneratorObject( |
} |
-Handle<JSArrayBuffer> Factory::NewJSArrayBuffer() { |
+Handle<JSArrayBuffer> Factory::NewJSArrayBuffer(SharedFlag shared) { |
Handle<JSFunction> array_buffer_fun( |
- isolate()->native_context()->array_buffer_fun()); |
+ shared == SharedFlag::kShared |
+ ? isolate()->native_context()->shared_array_buffer_fun() |
+ : isolate()->native_context()->array_buffer_fun()); |
CALL_HEAP_FUNCTION( |
isolate(), |
isolate()->heap()->AllocateJSObject(*array_buffer_fun), |
@@ -1934,7 +1936,8 @@ Handle<JSTypedArray> Factory::NewJSTypedArray(ElementsKind elements_kind, |
obj->set_length(*length_object); |
Handle<JSArrayBuffer> buffer = isolate()->factory()->NewJSArrayBuffer(); |
- Runtime::SetupArrayBuffer(isolate(), buffer, true, NULL, byte_length); |
+ Runtime::SetupArrayBuffer(isolate(), buffer, true, NULL, byte_length, |
+ SharedFlag::kNotShared); |
obj->set_buffer(*buffer); |
Handle<FixedTypedArrayBase> elements = |
isolate()->factory()->NewFixedTypedArray( |