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

Unified Diff: src/factory.cc

Issue 1136553006: Implement SharedArrayBuffer (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: merge master 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/factory.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « src/factory.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698