Chromium Code Reviews| Index: src/bootstrapper.cc |
| diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc |
| index 9b378b92bb5afa23726f719a2446c77817aeb31a..1633c386383b0e9cab9019ca30acf7036f71a7d4 100644 |
| --- a/src/bootstrapper.cc |
| +++ b/src/bootstrapper.cc |
| @@ -1667,6 +1667,7 @@ EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_unicode) |
| EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_unicode_regexps) |
| EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_computed_property_names) |
| EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_rest_parameters) |
| +EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_reflect) |
| void Genesis::InstallNativeFunctions_harmony_proxies() { |
| @@ -1721,6 +1722,17 @@ void Genesis::InitializeGlobal_harmony_unicode_regexps() { |
| } |
| +void Genesis::InitializeGlobal_harmony_reflect() { |
| + Handle<JSGlobalObject> global(JSGlobalObject::cast( |
|
Dmitry Lomov (no reviews)
2015/03/16 09:42:24
This has to be under if(FLAG_harmony_reflect)
caitp (gmail)
2015/03/16 13:08:01
Acknowledged.
|
| + native_context()->global_object())); |
| + Handle<String> reflect_string = |
| + factory()->NewStringFromStaticChars("Reflect"); |
| + Handle<Object> reflect = |
| + factory()->NewJSObject(isolate()->object_function(), TENURED); |
| + JSObject::AddProperty(global, reflect_string, reflect, DONT_ENUM); |
| +} |
| + |
| + |
| Handle<JSFunction> Genesis::InstallInternalArray( |
| Handle<JSBuiltinsObject> builtins, |
| const char* name, |
| @@ -2085,6 +2097,36 @@ bool Genesis::InstallNatives() { |
| *generator_object_prototype_map); |
| } |
| + // Install references to functions of the Reflect object |
|
Dmitry Lomov (no reviews)
2015/03/16 09:42:24
This should be under FLAG_harmony_reflect. Move it
caitp (gmail)
2015/03/16 13:08:01
I want these functions to be exposed to the runtim
|
| + { |
| + Handle<JSFunction> apply = |
| + InstallFunction(builtins, "ReflectApply", JS_OBJECT_TYPE, |
| + JSObject::kHeaderSize, MaybeHandle<JSObject>(), |
| + Builtins::kReflectApply); |
| + Handle<JSFunction> construct = |
| + InstallFunction(builtins, "ReflectConstruct", JS_OBJECT_TYPE, |
| + JSObject::kHeaderSize, MaybeHandle<JSObject>(), |
| + Builtins::kReflectConstruct); |
| + if (FLAG_vector_ics) { |
| + // Apply embeds an IC, so we need a type vector of size 1 in the shared |
| + // function info. |
| + FeedbackVectorSpec spec(0, 1); |
| + spec.SetKind(0, Code::CALL_IC); |
| + Handle<TypeFeedbackVector> feedback_vector = |
| + factory()->NewTypeFeedbackVector(spec); |
| + apply->shared()->set_feedback_vector(*feedback_vector); |
| + |
| + feedback_vector = factory()->NewTypeFeedbackVector(spec); |
| + construct->shared()->set_feedback_vector(*feedback_vector); |
| + } |
| + |
| + apply->shared()->set_internal_formal_parameter_count(3); |
| + apply->shared()->set_length(3); |
| + |
| + construct->shared()->set_internal_formal_parameter_count(3); |
| + construct->shared()->set_length(2); |
| + } |
| + |
| if (FLAG_disable_native_files) { |
| PrintF("Warning: Running without installed natives!\n"); |
| return true; |
| @@ -2284,6 +2326,8 @@ bool Genesis::InstallExperimentalNatives() { |
| static const char* harmony_unicode_regexps_natives[] = {NULL}; |
| static const char* harmony_computed_property_names_natives[] = {NULL}; |
| static const char* harmony_rest_parameters_natives[] = {NULL}; |
| + static const char* harmony_reflect_natives[] = {"native harmony-reflect.js", |
| + NULL}; |
| for (int i = ExperimentalNatives::GetDebuggerCount(); |
| i < ExperimentalNatives::GetBuiltinsCount(); i++) { |