Index: src/bootstrapper.cc |
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc |
index 9d2fc4368a60b2e4b5cd194007bfb8b93fda727d..87cd0d4a0cca13da51dd2134e55dd7b1fd9b81b7 100644 |
--- a/src/bootstrapper.cc |
+++ b/src/bootstrapper.cc |
@@ -2107,14 +2107,12 @@ bool Genesis::InstallNatives() { |
} |
// Install natives. |
- for (int i = Natives::GetDebuggerCount(); |
- i < Natives::GetBuiltinsCount(); |
- i++) { |
+ int i = Natives::GetDebuggerCount(); |
+ if (!CompileBuiltin(isolate(), i)) return false; |
+ if (!InstallJSBuiltins(builtins)) return false; |
+ |
+ for (++i; i < Natives::GetBuiltinsCount(); ++i) { |
if (!CompileBuiltin(isolate(), i)) return false; |
- // TODO(ager): We really only need to install the JS builtin |
- // functions on the builtins object after compiling and running |
- // runtime.js. |
- if (!InstallJSBuiltins(builtins)) return false; |
} |
InstallNativeFunctions(); |
@@ -2610,15 +2608,7 @@ bool Genesis::InstallJSBuiltins(Handle<JSBuiltinsObject> builtins) { |
Handle<Object> function_object = Object::GetProperty( |
isolate(), builtins, Builtins::GetName(id)).ToHandleChecked(); |
Handle<JSFunction> function = Handle<JSFunction>::cast(function_object); |
- // TODO(mstarzinger): This is just a temporary hack to make TurboFan work, |
- // the correct solution is to restore the context register after invoking |
- // builtins from full-codegen. |
- function->shared()->DisableOptimization(kBuiltinFunctionCannotBeOptimized); |
builtins->set_javascript_builtin(id, *function); |
- if (!Compiler::EnsureCompiled(function, CLEAR_EXCEPTION)) { |
- return false; |
- } |
- builtins->set_javascript_builtin_code(id, function->shared()->code()); |
} |
return true; |
} |