Chromium Code Reviews| Index: src/bootstrapper.cc |
| diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc |
| index 983da4787fe5a3064b3369e7e8f550544c8beeea..50c07c3c546a0f033851bebce3df359ca5994345 100644 |
| --- a/src/bootstrapper.cc |
| +++ b/src/bootstrapper.cc |
| @@ -1314,6 +1314,27 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> global_object, |
| InstallFunction(global, "WeakSet", JS_WEAK_SET_TYPE, JSWeakSet::kSize, |
| isolate->initial_object_prototype(), Builtins::kIllegal); |
| + { |
|
Dan Ehrenberg
2015/07/09 00:23:17
Looks like this code runs regardless of --harmony_
bbudge
2015/07/09 01:11:32
Fixed.
|
| + // -- S I M D |
| + Handle<String> name = factory->InternalizeUtf8String("SIMD"); |
| + Handle<JSFunction> cons = factory->NewFunction(name); |
| + JSFunction::SetInstancePrototype( |
| + cons, |
| + Handle<Object>(native_context()->initial_object_prototype(), isolate)); |
| + cons->SetInstanceClassName(*name); |
| + Handle<JSObject> simd_object = factory->NewJSObject(cons, TENURED); |
| + DCHECK(simd_object->IsJSObject()); |
| + JSObject::AddProperty(global, name, simd_object, DONT_ENUM); |
| + |
| + Handle<JSFunction> float32x4_function = InstallFunction( |
| + simd_object, "Float32x4", JS_VALUE_TYPE, JSValue::kSize, |
| + isolate->initial_object_prototype(), Builtins::kIllegal); |
| + // Set the instance class name since InstallFunction only does this when |
| + // we install on the GlobalObject. |
| + float32x4_function->SetInstanceClassName(*factory->Float32x4_string()); |
| + native_context()->set_float32x4_function(*float32x4_function); |
| + } |
| + |
| { // --- sloppy arguments map |
| // Make sure we can recognize argument objects at runtime. |
| // This is done by introducing an anonymous function with |
| @@ -1819,6 +1840,7 @@ EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_spread_arrays) |
| EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_sharedarraybuffer) |
| EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_atomics) |
| EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_new_target) |
| +EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_simd) |
| void Genesis::InstallNativeFunctions_harmony_proxies() { |
| @@ -1850,6 +1872,7 @@ EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_object) |
| EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_spread_arrays) |
| EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_atomics) |
| EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_new_target) |
| +EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_simd) |
| void Genesis::InitializeGlobal_harmony_regexps() { |
| Handle<JSObject> builtins(native_context()->builtins()); |
| @@ -2500,6 +2523,8 @@ bool Genesis::InstallExperimentalNatives() { |
| static const char* harmony_atomics_natives[] = {"native harmony-atomics.js", |
| nullptr}; |
| static const char* harmony_new_target_natives[] = {nullptr}; |
| + static const char* harmony_simd_natives[] = {"native harmony-simd.js", |
| + nullptr}; |
| for (int i = ExperimentalNatives::GetDebuggerCount(); |
| i < ExperimentalNatives::GetBuiltinsCount(); i++) { |