Commit df711833 authored by verwaest's avatar verwaest Committed by Commit bot

[crankshaft] Allow inlining of base constructors

This speeds up base constructor instantiation by ~3x.

BUG=

Review URL: https://codereview.chromium.org/1673163002

Cr-Commit-Position: refs/heads/master@{#33805}
parent ee57e14c
......@@ -8388,10 +8388,12 @@ bool HOptimizedGraphBuilder::TryInline(Handle<JSFunction> target,
CompilationInfo target_info(&parse_info);
Handle<SharedFunctionInfo> target_shared(target->shared());
if (IsClassConstructor(target_shared->kind())) {
if (inlining_kind != CONSTRUCT_CALL_RETURN &&
IsClassConstructor(target_shared->kind())) {
TraceInline(target, caller, "target is classConstructor");
return false;
}
if (target_shared->HasDebugInfo()) {
TraceInline(target, caller, "target is being debugged");
return false;
......@@ -9903,7 +9905,7 @@ void HOptimizedGraphBuilder::BuildInlinedCallArray(
// Checks whether allocation using the given constructor can be inlined.
static bool IsAllocationInlineable(Handle<JSFunction> constructor) {
return constructor->has_initial_map() &&
!IsClassConstructor(constructor->shared()->kind()) &&
!IsSubclassConstructor(constructor->shared()->kind()) &&
constructor->initial_map()->instance_type() == JS_OBJECT_TYPE &&
constructor->initial_map()->instance_size() <
HAllocate::kMaxInlineSize;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment