| Index: src/bootstrapper.cc
|
| diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
|
| index feb4865791d6f6d0caa319f32f258830892526e1..29d7fa43eb4a2ff168f4003539dcba7363be91b6 100644
|
| --- a/src/bootstrapper.cc
|
| +++ b/src/bootstrapper.cc
|
| @@ -228,6 +228,7 @@ class Genesis BASE_EMBEDDED {
|
| bool InstallExperimentalNatives();
|
| bool InstallExtraNatives();
|
| void InstallBuiltinFunctionIds();
|
| + void InstallExperimentalBuiltinFunctionIds();
|
| void InstallJSFunctionResultCaches();
|
| void InitializeNormalizedMapCaches();
|
|
|
| @@ -1727,6 +1728,7 @@ EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_spreadcalls)
|
| EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_destructuring)
|
| EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_object)
|
| EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_shared_typed_arrays)
|
| +EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_atomics)
|
|
|
|
|
| void Genesis::InstallNativeFunctions_harmony_proxies() {
|
| @@ -1738,6 +1740,7 @@ void Genesis::InstallNativeFunctions_harmony_proxies() {
|
| }
|
| }
|
|
|
| +
|
| #undef INSTALL_NATIVE
|
|
|
| #define EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(id) \
|
| @@ -1757,6 +1760,7 @@ EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_rest_parameters)
|
| EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_spreadcalls)
|
| EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_destructuring)
|
| EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_object)
|
| +EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_atomics)
|
|
|
| void Genesis::InitializeGlobal_harmony_regexps() {
|
| Handle<JSObject> builtins(native_context()->builtins());
|
| @@ -2412,7 +2416,9 @@ bool Genesis::InstallExperimentalNatives() {
|
| NULL};
|
| static const char* harmony_shared_typed_arrays_natives[] = {
|
| "native harmony-sharedarraybuffer.js",
|
| - "native harmony-sharedtypedarray.js", NULL};
|
| + "native harmony-sharedtypedarray.js", nullptr};
|
| + static const char* harmony_atomics_natives[] = {"native harmony-atomics.js",
|
| + nullptr};
|
|
|
| for (int i = ExperimentalNatives::GetDebuggerCount();
|
| i < ExperimentalNatives::GetBuiltinsCount(); i++) {
|
| @@ -2433,6 +2439,7 @@ bool Genesis::InstallExperimentalNatives() {
|
| }
|
|
|
| InstallExperimentalNativeFunctions();
|
| + InstallExperimentalBuiltinFunctionIds();
|
| return true;
|
| }
|
|
|
| @@ -2458,6 +2465,11 @@ static void InstallBuiltinFunctionId(Handle<JSObject> holder,
|
| }
|
|
|
|
|
| +#define INSTALL_BUILTIN_ID(holder_expr, fun_name, name) \
|
| + { #holder_expr, #fun_name, k##name } \
|
| + ,
|
| +
|
| +
|
| void Genesis::InstallBuiltinFunctionIds() {
|
| HandleScope scope(isolate());
|
| struct BuiltinFunctionIds {
|
| @@ -2466,12 +2478,8 @@ void Genesis::InstallBuiltinFunctionIds() {
|
| BuiltinFunctionId id;
|
| };
|
|
|
| -#define INSTALL_BUILTIN_ID(holder_expr, fun_name, name) \
|
| - { #holder_expr, #fun_name, k##name } \
|
| - ,
|
| const BuiltinFunctionIds builtins[] = {
|
| FUNCTIONS_WITH_ID_LIST(INSTALL_BUILTIN_ID)};
|
| -#undef INSTALL_BUILTIN_ID
|
|
|
| for (const BuiltinFunctionIds& builtin : builtins) {
|
| Handle<JSObject> holder =
|
| @@ -2481,6 +2489,29 @@ void Genesis::InstallBuiltinFunctionIds() {
|
| }
|
|
|
|
|
| +void Genesis::InstallExperimentalBuiltinFunctionIds() {
|
| + if (FLAG_harmony_atomics) {
|
| + struct BuiltinFunctionIds {
|
| + const char* holder_expr;
|
| + const char* fun_name;
|
| + BuiltinFunctionId id;
|
| + };
|
| +
|
| + const BuiltinFunctionIds atomic_builtins[] = {
|
| + ATOMIC_FUNCTIONS_WITH_ID_LIST(INSTALL_BUILTIN_ID)};
|
| +
|
| + for (const BuiltinFunctionIds& builtin : atomic_builtins) {
|
| + Handle<JSObject> holder =
|
| + ResolveBuiltinIdHolder(native_context(), builtin.holder_expr);
|
| + InstallBuiltinFunctionId(holder, builtin.fun_name, builtin.id);
|
| + }
|
| + }
|
| +}
|
| +
|
| +
|
| +#undef INSTALL_BUILTIN_ID
|
| +
|
| +
|
| // Do not forget to update macros.py with named constant
|
| // of cache id.
|
| #define JSFUNCTION_RESULT_CACHE_LIST(F) \
|
|
|