Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(528)

Unified Diff: src/bootstrapper.cc

Issue 327173002: Optimize various forms of slice.call(arguments, ...) (Closed) Base URL: https://github.com/v8/v8.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/contexts.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
}
« no previous file with comments | « no previous file | src/contexts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698