From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- .../irregexp/imported/regexp-bytecode-peephole.h | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 js/src/irregexp/imported/regexp-bytecode-peephole.h (limited to 'js/src/irregexp/imported/regexp-bytecode-peephole.h') diff --git a/js/src/irregexp/imported/regexp-bytecode-peephole.h b/js/src/irregexp/imported/regexp-bytecode-peephole.h new file mode 100644 index 0000000000..5b8a0c7b4b --- /dev/null +++ b/js/src/irregexp/imported/regexp-bytecode-peephole.h @@ -0,0 +1,30 @@ +// Copyright 2019 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef V8_REGEXP_REGEXP_BYTECODE_PEEPHOLE_H_ +#define V8_REGEXP_REGEXP_BYTECODE_PEEPHOLE_H_ + +#include "irregexp/RegExpShim.h" + +namespace v8 { +namespace internal { + +class ByteArray; + +// Peephole optimization for regexp interpreter bytecode. +// Pre-defined bytecode sequences occuring in the bytecode generated by the +// RegExpBytecodeGenerator can be optimized into a single bytecode. +class RegExpBytecodePeepholeOptimization : public AllStatic { + public: + // Performs peephole optimization on the given bytecode and returns the + // optimized bytecode. + static Handle OptimizeBytecode( + Isolate* isolate, Zone* zone, Handle source, const byte* bytecode, + int length, const ZoneUnorderedMap& jump_edges); +}; + +} // namespace internal +} // namespace v8 + +#endif // V8_REGEXP_REGEXP_BYTECODE_PEEPHOLE_H_ -- cgit v1.2.3