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

Unified Diff: src/bootstrapper.cc

Issue 1617503003: [Atomics] code stubs for atomic operations (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: smi dcheck Created 4 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 side-by-side diff with in-line comments
Download patch
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 0d1c070e47e36418ee566dd637d97f72a2fcd8ec..d1b0277172efca5695d39e1eae61b39494d6b0d9 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -2426,9 +2426,24 @@ void Genesis::InitializeGlobal_harmony_sharedarraybuffer() {
if (!FLAG_harmony_sharedarraybuffer) return;
Handle<JSGlobalObject> global(native_context()->global_object());
+ Isolate* isolate = global->GetIsolate();
+ Factory* factory = isolate->factory();
+
Handle<JSFunction> shared_array_buffer_fun =
InstallArrayBuffer(global, "SharedArrayBuffer");
native_context()->set_shared_array_buffer_fun(*shared_array_buffer_fun);
+
+ Handle<String> name = factory->InternalizeUtf8String("Atomics");
+ Handle<JSFunction> cons = factory->NewFunction(name);
+ JSFunction::SetInstancePrototype(
+ cons,
+ Handle<Object>(native_context()->initial_object_prototype(), isolate));
+ Handle<JSObject> atomics_object = factory->NewJSObject(cons, TENURED);
+ DCHECK(atomics_object->IsJSObject());
+ JSObject::AddProperty(global, name, atomics_object, DONT_ENUM);
+
+ SimpleInstallFunction(atomics_object, factory->InternalizeUtf8String("load"),
+ Builtins::kAtomicsLoadCheck, 2, true);
}

Powered by Google App Engine
This is Rietveld 408576698