diff --git a/js/src/irregexp/imported/regexp-bytecode-peephole.cc b/js/src/irregexp/imported/regexp-bytecode-peephole.cc --- a/imported/regexp-bytecode-peephole.cc +++ b/imported/regexp-bytecode-peephole.cc @@ -1087,7 +1087,6 @@ // Run the peephole optimizer until we've reached a fixed point. All relevant // data structures ping-pong between src and dst_writer. - bool any_pass_optimized = false; for (;;) { dst_writer->Reset(); // TODO(jgruber): This currently recreates standard definitions for each @@ -1096,7 +1095,6 @@ bool this_pass_optimized = BytecodePeephole::OptimizeBytecode(zone, src_writer, dst_writer); if (!this_pass_optimized) break; - any_pass_optimized = true; std::swap(dst_writer, src_writer); } @@ -1109,18 +1107,6 @@ isolate->factory()->NewTrustedByteArray(optimized_length); MemCopy(array->begin(), optimized_bytecode, optimized_length); - if (any_pass_optimized && v8_flags.trace_regexp_peephole_optimization) { - std::unique_ptr pattern_cstring = - re_data->escaped_source()->ToCString(); - PrintF("Original Bytecode:\n"); - RegExpBytecodeDisassemble(original_bytecode->data(), - static_cast(original_bytecode->size()), - pattern_cstring.get()); - PrintF("Optimized Bytecode:\n"); - RegExpBytecodeDisassemble(array->begin(), optimized_length, - pattern_cstring.get()); - } - return array; } diff --git a/js/src/irregexp/imported/regexp-bytecodes-inl.h b/js/src/irregexp/imported/regexp-bytecodes-inl.h index 78f63ca35f..f6cd7fb82f 100644 --- a/imported/regexp-bytecodes-inl.h +++ b/imported/regexp-bytecodes-inl.h @@ -75,7 +75,7 @@ } template -consteval std::array SplitNames(const char* raw_names) { +constexpr std::array SplitNames(const char* raw_names) { std::array result; std::string_view names(raw_names); @@ -104,7 +104,7 @@ // Calculates packed offsets for each Bytecode operand. // All operands are aligned to their own size. template -consteval auto CalculateAlignedOffsets() { +constexpr auto CalculateAlignedOffsets() { constexpr int N = sizeof...(operand_types); constexpr std::array kOperandSizes = { OperandTypeTraits::kSize...}; @@ -174,14 +174,14 @@ using Traits = BytecodeOperandsTraits; static constexpr int kCount = Traits::kOperandCount; static constexpr int kTotalSize = Traits::kSize; - static consteval int Index(Operand op) { return static_cast(op); } - static consteval int Size(Operand op) { + static constexpr int Index(Operand op) { return static_cast(op); } + static constexpr int Size(Operand op) { return Traits::kOperandSizes[Index(op)]; } - static consteval int Offset(Operand op) { + static constexpr int Offset(Operand op) { return Traits::kOperandOffsets[Index(op)]; } - static consteval BytecodeOperandType Type(Operand op) { + static constexpr BytecodeOperandType Type(Operand op) { return Traits::kOperandTypes[Index(op)]; } @@ -190,7 +190,7 @@ } // Returns a tuple of all operands. - static consteval auto GetOperandsTuple() { + static constexpr auto GetOperandsTuple() { return [](std::index_sequence) { return std::tuple_cat([]() { constexpr auto id = static_cast(I); diff --git a/js/src/irregexp/imported/regexp-code-generator.cc b/js/src/irregexp/imported/regexp-code-generator.cc --- a/imported/regexp-code-generator.cc +++ b/imported/regexp-code-generator.cc @@ -36,20 +36,6 @@ USE(isolate_); USE(masm_); - // Bytecode analysis is currently unused. In future work it could form the - // basis for compiler optimizations. - if (V8_UNLIKELY(v8_flags.regexp_bytecode_analysis)) { - BytecodeAnalysis analysis(isolate_, &zone_, bytecode_); - analysis.Analyze(); - if (v8_flags.trace_regexp_bytecode_analysis) { - std::unique_ptr pattern_cstring = - re_data->escaped_source()->ToCString(); - RegExpBytecodeDisassemble(bytecode_->begin(), - bytecode_->ulength().value(), - pattern_cstring.get(), &analysis); - } - } - PreVisitBytecodes(); iter_.reset(); VisitBytecodes();