Index: src/bootstrapper.cc |
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc |
index cfef267892e7f7a8970927483dba35016cb52755..ca8c440a6a3e6e8b974a8b8aad24a3a4090819f4 100644 |
--- a/src/bootstrapper.cc |
+++ b/src/bootstrapper.cc |
@@ -2058,34 +2058,40 @@ static Handle<JSObject> ResolveBuiltinIdHolder( |
static void InstallBuiltinFunctionId(Handle<JSObject> holder, |
const char* function_name, |
- BuiltinFunctionId id) { |
+ BuiltinFunctionId id, |
+ Handle<FixedArray> builtins) { |
Isolate* isolate = holder->GetIsolate(); |
Handle<Object> function_object = |
Object::GetProperty(isolate, holder, function_name).ToHandleChecked(); |
Handle<JSFunction> function = Handle<JSFunction>::cast(function_object); |
function->shared()->set_function_data(Smi::FromInt(id)); |
+ builtins->set(static_cast<int>(id), *function); |
} |
void Genesis::InstallBuiltinFunctionIds() { |
HandleScope scope(isolate()); |
-#define INSTALL_BUILTIN_ID(holder_expr, fun_name, name) \ |
- { \ |
- Handle<JSObject> holder = ResolveBuiltinIdHolder( \ |
- native_context(), #holder_expr); \ |
- BuiltinFunctionId id = k##name; \ |
- InstallBuiltinFunctionId(holder, #fun_name, id); \ |
+ Handle<FixedArray> builtins = factory()->NewFixedArray(kBuiltinsLength, |
+ TENURED); |
+#define INSTALL_BUILTIN_ID(holder_expr, fun_name, name) \ |
+ { \ |
+ Handle<JSObject> holder = ResolveBuiltinIdHolder( \ |
+ native_context(), #holder_expr); \ |
+ BuiltinFunctionId id = k##name; \ |
+ InstallBuiltinFunctionId(holder, #fun_name, id, builtins); \ |
} |
FUNCTIONS_WITH_ID_LIST(INSTALL_BUILTIN_ID) |
#undef INSTALL_BUILTIN_ID |
+ native_context()->set_builtin_js_functions(*builtins); |
} |
void Genesis::InstallExperimentalBuiltinFunctionIds() { |
HandleScope scope(isolate()); |
+ Handle<FixedArray> builtins(native_context()->builtin_js_functions()); |
if (FLAG_harmony_maths) { |
Handle<JSObject> holder = ResolveBuiltinIdHolder(native_context(), "Math"); |
- InstallBuiltinFunctionId(holder, "clz32", kMathClz32); |
+ InstallBuiltinFunctionId(holder, "clz32", kMathClz32, builtins); |
} |
} |