Source code

Revision control

Copy as Markdown

Other Tools

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<char[]> pattern_cstring =
- re_data->escaped_source()->ToCString();
- PrintF("Original Bytecode:\n");
- RegExpBytecodeDisassemble(original_bytecode->data(),
- static_cast<uint32_t>(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 <size_t N>
-consteval std::array<std::string_view, N> SplitNames(const char* raw_names) {
+constexpr std::array<std::string_view, N> SplitNames(const char* raw_names) {
std::array<std::string_view, N> 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 <BytecodeOperandType... operand_types>
-consteval auto CalculateAlignedOffsets() {
+constexpr auto CalculateAlignedOffsets() {
constexpr int N = sizeof...(operand_types);
constexpr std::array<uint8_t, N> kOperandSizes = {
OperandTypeTraits<operand_types>::kSize...};
@@ -174,14 +174,14 @@
using Traits = BytecodeOperandsTraits<OpTypes...>;
static constexpr int kCount = Traits::kOperandCount;
static constexpr int kTotalSize = Traits::kSize;
- static consteval int Index(Operand op) { return static_cast<uint8_t>(op); }
- static consteval int Size(Operand op) {
+ static constexpr int Index(Operand op) { return static_cast<uint8_t>(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 []<size_t... Is>(std::index_sequence<Is...>) {
return std::tuple_cat([]<size_t I>() {
constexpr auto id = static_cast<Operand>(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<char[]> pattern_cstring =
- re_data->escaped_source()->ToCString();
- RegExpBytecodeDisassemble(bytecode_->begin(),
- bytecode_->ulength().value(),
- pattern_cstring.get(), &analysis);
- }
- }
-
PreVisitBytecodes();
iter_.reset();
VisitBytecodes();