From 66ed7761b3ab5d6c8364412eab2e2820789466cb Mon Sep 17 00:00:00 2001 From: Ross McIlroy Date: Tue, 16 Apr 2019 18:10:35 +0100 Subject: [PATCH] [Interpreter] Ensure Inc/DecHandler doesn't allocate a frame for fast-path. Avoids allocating a frame for the fast-path in IncHandler by marking some calling branches as Deferred. Also avoid loading feedback slot and vector until it's needed to reduce live range. This reduces the time needed for a tight loop in Ignition (e.g., while (i < 1000000000) ++i;) from 15.5s to 12.8s. BUG=v8:9133 Change-Id: I0a62efdaefca7f3024b3ae05c61631a63cb01390 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1570005 Commit-Queue: Ross McIlroy Reviewed-by: Dan Elphick Cr-Commit-Position: refs/heads/master@{#60893} --- src/interpreter/interpreter-generator.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/interpreter/interpreter-generator.cc b/src/interpreter/interpreter-generator.cc index 3479223a66..f111b4b7c6 100644 --- a/src/interpreter/interpreter-generator.cc +++ b/src/interpreter/interpreter-generator.cc @@ -1187,9 +1187,6 @@ class UnaryNumericOpAssembler : public InterpreterAssembler { void UnaryOpWithFeedback() { VARIABLE(var_value, MachineRepresentation::kTagged, GetAccumulator()); - Node* slot_index = BytecodeOperandIdx(0); - Node* maybe_feedback_vector = LoadFeedbackVector(); - VARIABLE(var_result, MachineRepresentation::kTagged); VARIABLE(var_float_value, MachineRepresentation::kFloat64); TVARIABLE(Smi, var_feedback, SmiConstant(BinaryOperationFeedback::kNone)); @@ -1200,8 +1197,9 @@ class UnaryNumericOpAssembler : public InterpreterAssembler { // We might have to try again after ToNumeric conversion. BIND(&start); { - Label if_smi(this), if_heapnumber(this), if_bigint(this); - Label if_oddball(this), if_other(this); + Label if_smi(this), if_heapnumber(this), if_oddball(this); + Label if_bigint(this, Label::kDeferred); + Label if_other(this, Label::kDeferred); Node* value = var_value.value(); GotoIf(TaggedIsSmi(value), &if_smi); Node* map = LoadMap(value); @@ -1267,6 +1265,8 @@ class UnaryNumericOpAssembler : public InterpreterAssembler { } BIND(&end); + Node* slot_index = BytecodeOperandIdx(0); + Node* maybe_feedback_vector = LoadFeedbackVector(); UpdateFeedback(var_feedback.value(), maybe_feedback_vector, slot_index); SetAccumulator(var_result.value()); Dispatch();