Index: src/bootstrapper.cc |
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc |
index a5b4b1b8380788c06ae70e4f74ffcc9f199b5416..d18ac94612dd8f4506af645d6e642853373fbc50 100644 |
--- a/src/bootstrapper.cc |
+++ b/src/bootstrapper.cc |
@@ -242,7 +242,6 @@ class Genesis BASE_EMBEDDED { |
v8::RegisteredExtension* current, |
ExtensionStates* extension_states); |
static bool InstallSpecialObjects(Handle<Context> native_context); |
- bool InstallJSBuiltins(Handle<JSBuiltinsObject> builtins); |
bool ConfigureApiObject(Handle<JSObject> object, |
Handle<ObjectTemplateInfo> object_template); |
bool ConfigureGlobalObjects( |
@@ -1869,6 +1868,24 @@ void Bootstrapper::ImportExperimentalNatives(Isolate* isolate, |
#undef INSTALL_NATIVE |
+ |
+bool Bootstrapper::InstallJSBuiltins(Isolate* isolate, |
+ Handle<JSObject> container) { |
+ HandleScope scope(isolate); |
+ Handle<JSBuiltinsObject> builtins = isolate->js_builtins_object(); |
+ for (int i = 0; i < Builtins::NumberOfJavaScriptBuiltins(); i++) { |
+ Builtins::JavaScript id = static_cast<Builtins::JavaScript>(i); |
+ Handle<Object> function_object = |
+ Object::GetProperty(isolate, container, Builtins::GetName(id)) |
+ .ToHandleChecked(); |
+ DCHECK(function_object->IsJSFunction()); |
+ Handle<JSFunction> function = Handle<JSFunction>::cast(function_object); |
+ builtins->set_javascript_builtin(id, *function); |
+ } |
+ return true; |
+} |
+ |
+ |
#define EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(id) \ |
void Genesis::InitializeGlobal_##id() {} |
@@ -2098,7 +2115,6 @@ bool Genesis::InstallNatives(ContextType context_type) { |
if (!Bootstrapper::CompileBuiltin(isolate(), builtin_index++)) return false; |
DCHECK_EQ(builtin_index, Natives::GetIndex("runtime")); |
if (!Bootstrapper::CompileBuiltin(isolate(), builtin_index++)) return false; |
- if (!InstallJSBuiltins(builtins)) return false; |
// A thin context is ready at this point. |
if (context_type == THIN_CONTEXT) return true; |
@@ -2908,19 +2924,6 @@ bool Genesis::InstallExtension(Isolate* isolate, |
} |
-bool Genesis::InstallJSBuiltins(Handle<JSBuiltinsObject> builtins) { |
- HandleScope scope(isolate()); |
- for (int i = 0; i < Builtins::NumberOfJavaScriptBuiltins(); i++) { |
- Builtins::JavaScript id = static_cast<Builtins::JavaScript>(i); |
- Handle<Object> function_object = Object::GetProperty( |
- isolate(), builtins, Builtins::GetName(id)).ToHandleChecked(); |
- Handle<JSFunction> function = Handle<JSFunction>::cast(function_object); |
- builtins->set_javascript_builtin(id, *function); |
- } |
- return true; |
-} |
- |
- |
bool Genesis::ConfigureGlobalObjects( |
v8::Local<v8::ObjectTemplate> global_proxy_template) { |
Handle<JSObject> global_proxy( |