[TurboFan] Apply early lowering logic to the GetIterator bytecode

GetIterator currently acts as a property load of the iterator symbol
(soon it will also call it). It makes sense to apply the same early
lowering logic as we do for property loads in the bytecode graph
builder. This also brings our treatment of the bytecode in-line with
the way it's treated in the serializer, which already respects the
early-lowering semantics.

Bug: v8:7790
Change-Id: Ieadc4b307b9f6d9a5aa77ca10c7c818026776f33
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1758304
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63224}
This commit is contained in:
Mike Stanton 2019-08-16 15:53:23 +02:00 committed by Commit Bot
parent 1b7f99a0cb
commit 3815fc1953
2 changed files with 9 additions and 1 deletions

View File

@ -3302,6 +3302,12 @@ void BytecodeGraphBuilder::VisitGetIterator() {
VectorSlotPair feedback = VectorSlotPair feedback =
CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(1)); CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(1));
const Operator* op = javascript()->GetIterator(feedback); const Operator* op = javascript()->GetIterator(feedback);
JSTypeHintLowering::LoweringResult lowering =
TryBuildSimplifiedLoadNamed(op, object, feedback.slot());
if (lowering.IsExit()) return;
DCHECK(!lowering.Changed());
Node* node = NewNode(op, object); Node* node = NewNode(op, object);
environment()->BindAccumulator(node, Environment::kAttachFrameState); environment()->BindAccumulator(node, Environment::kAttachFrameState);
} }

View File

@ -490,7 +490,9 @@ JSTypeHintLowering::LoweringResult JSTypeHintLowering::ReduceConstructOperation(
JSTypeHintLowering::LoweringResult JSTypeHintLowering::ReduceLoadNamedOperation( JSTypeHintLowering::LoweringResult JSTypeHintLowering::ReduceLoadNamedOperation(
const Operator* op, Node* receiver, Node* effect, Node* control, const Operator* op, Node* receiver, Node* effect, Node* control,
FeedbackSlot slot) const { FeedbackSlot slot) const {
DCHECK_EQ(IrOpcode::kJSLoadNamed, op->opcode()); // JSGetIterator involves a named load of the Symbol.iterator property.
DCHECK(op->opcode() == IrOpcode::kJSLoadNamed ||
op->opcode() == IrOpcode::kJSGetIterator);
DCHECK(!slot.IsInvalid()); DCHECK(!slot.IsInvalid());
FeedbackNexus nexus(feedback_vector(), slot); FeedbackNexus nexus(feedback_vector(), slot);
if (Node* node = TryBuildSoftDeopt( if (Node* node = TryBuildSoftDeopt(