Commit 083ac179 authored by Benedikt Meurer's avatar Benedikt Meurer Committed by Commit Bot

[turbofan] Fix logic error in ReduceJSConstruct.

Don't return NoChange when the new_target input to a JSConstruct node is
already a HeapConstant, but rather use that constant in the interesting
lowering below. This was introduced accidentally by 

  https://chromium-review.googlesource.com/604790

earlier. Also don't use ShouldUseCallICFeedback predicate here, as that
doesn't really make sense for JSConstruct, but is mostly interesting for
JSCall (hence the name).

Bug: v8:5517, v8:6399, v8:6679
Change-Id: I96201281cf1a10f2bfd2dc3859455161eb310ccf
Reviewed-on: https://chromium-review.googlesource.com/607887Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47237}
parent 703b5ff9
...@@ -1411,10 +1411,8 @@ Reduction JSCallReducer::ReduceJSConstruct(Node* node) { ...@@ -1411,10 +1411,8 @@ Reduction JSCallReducer::ReduceJSConstruct(Node* node) {
NodeProperties::ReplaceValueInput(node, array_function, 1); NodeProperties::ReplaceValueInput(node, array_function, 1);
NodeProperties::ChangeOp(node, javascript()->CreateArray(arity, site)); NodeProperties::ChangeOp(node, javascript()->CreateArray(arity, site));
return Changed(node); return Changed(node);
} else if (feedback->IsWeakCell()) { } else if (feedback->IsWeakCell() &&
// Check if we want to use CallIC feedback here. !HeapObjectMatcher(new_target).HasValue()) {
if (!ShouldUseCallICFeedback(new_target)) return NoChange();
Handle<WeakCell> cell = Handle<WeakCell>::cast(feedback); Handle<WeakCell> cell = Handle<WeakCell>::cast(feedback);
if (cell->value()->IsConstructor()) { if (cell->value()->IsConstructor()) {
Node* new_target_feedback = Node* new_target_feedback =
......
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