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

Unified Diff: src/bootstrapper.cc

Issue 1881383003: [Atomics] code stubs for atomic operations (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix unused function 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
« no previous file with comments | « src/arm64/interface-descriptors-arm64.cc ('k') | src/builtins.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index ba076a102d45d96069f7f3bfb72aa8d98c5910db..983b55fef8f4c093950337dbbfb0b1a595c485e1 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -2442,9 +2442,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);
}
« no previous file with comments | « src/arm64/interface-descriptors-arm64.cc ('k') | src/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698