Commit b2971002 authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[turbofan] Do not force initial map creation.

Forcing it seems unnecessary and hinders concurrent compilation.

Also turn a related condition into a CHECK.

Bug: v8:7790
Change-Id: Ie7d7e47e6bc2743d742cfe07e65436c1b8b994f3
Reviewed-on: https://chromium-review.googlesource.com/1177705Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55164}
parent 5d69010e
...@@ -44,8 +44,9 @@ Node* GetArgumentsFrameState(Node* frame_state) { ...@@ -44,8 +44,9 @@ Node* GetArgumentsFrameState(Node* frame_state) {
// inlined. // inlined.
bool IsAllocationInlineable(const JSFunctionRef& target, bool IsAllocationInlineable(const JSFunctionRef& target,
const JSFunctionRef& new_target) { const JSFunctionRef& new_target) {
CHECK_IMPLIES(new_target.has_initial_map(),
!new_target.initial_map().is_dictionary_map());
return new_target.has_initial_map() && return new_target.has_initial_map() &&
!new_target.initial_map().is_dictionary_map() &&
new_target.initial_map().constructor_or_backpointer().equals(target); new_target.initial_map().constructor_or_backpointer().equals(target);
} }
...@@ -412,7 +413,7 @@ Reduction JSCreateLowering::ReduceJSCreateGeneratorObject(Node* node) { ...@@ -412,7 +413,7 @@ Reduction JSCreateLowering::ReduceJSCreateGeneratorObject(Node* node) {
DCHECK(closure_type.AsHeapConstant()->Ref().IsJSFunction()); DCHECK(closure_type.AsHeapConstant()->Ref().IsJSFunction());
JSFunctionRef js_function = JSFunctionRef js_function =
closure_type.AsHeapConstant()->Ref().AsJSFunction(); closure_type.AsHeapConstant()->Ref().AsJSFunction();
js_function.EnsureHasInitialMap(); if (!js_function.has_initial_map()) return NoChange();
SlackTrackingPrediction slack_tracking_prediction = SlackTrackingPrediction slack_tracking_prediction =
dependencies()->DependOnInitialMapInstanceSizePrediction(js_function); dependencies()->DependOnInitialMapInstanceSizePrediction(js_function);
......
...@@ -411,10 +411,9 @@ Reduction JSNativeContextSpecialization::ReduceJSOrdinaryHasInstance( ...@@ -411,10 +411,9 @@ Reduction JSNativeContextSpecialization::ReduceJSOrdinaryHasInstance(
if (function->IsConstructor() && function->has_prototype_slot() && if (function->IsConstructor() && function->has_prototype_slot() &&
function->has_instance_prototype() && function->has_instance_prototype() &&
function->prototype()->IsJSReceiver()) { function->prototype()->IsJSReceiver()) {
// Ensure that the {function} has a valid initial map, so we can // We need {function}'s initial map so that we can depend on it for the
// depend on that for the prototype constant-folding below. // prototype constant-folding below.
JSFunction::EnsureHasInitialMap(function); if (!function->has_initial_map()) return NoChange();
MapRef initial_map = dependencies()->DependOnInitialMap( MapRef initial_map = dependencies()->DependOnInitialMap(
JSFunctionRef(js_heap_broker(), function)); JSFunctionRef(js_heap_broker(), function));
Node* prototype = jsgraph()->Constant( Node* prototype = jsgraph()->Constant(
...@@ -1104,11 +1103,13 @@ Reduction JSNativeContextSpecialization::ReduceJSLoadNamed(Node* node) { ...@@ -1104,11 +1103,13 @@ Reduction JSNativeContextSpecialization::ReduceJSLoadNamed(Node* node) {
p.name().is_identical_to(factory()->prototype_string())) { p.name().is_identical_to(factory()->prototype_string())) {
// Optimize "prototype" property of functions. // Optimize "prototype" property of functions.
Handle<JSFunction> function = Handle<JSFunction>::cast(m.Value()); Handle<JSFunction> function = Handle<JSFunction>::cast(m.Value());
if (!function->has_prototype_slot() || !function->has_initial_map()) {
return NoChange();
}
if (!function->PrototypeRequiresRuntimeLookup()) { if (!function->PrototypeRequiresRuntimeLookup()) {
// We need to add a code dependency on the initial map of the // We need to add a code dependency on the initial map of the
// {function} in order to be notified about changes to the // {function} in order to be notified about changes to the
// "prototype" of {function}. // "prototype" of {function}.
JSFunction::EnsureHasInitialMap(function);
dependencies()->DependOnInitialMap( dependencies()->DependOnInitialMap(
JSFunctionRef(js_heap_broker(), function)); JSFunctionRef(js_heap_broker(), function));
Handle<Object> prototype(function->prototype(), isolate()); Handle<Object> prototype(function->prototype(), isolate());
......
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