#include "src/regexp/experimental/experimental.h"
#include <optional>
#include "src/common/assert-scope.h"
#include "src/objects/js-regexp-inl.h"
#include "src/regexp/experimental/experimental-compiler.h"
#include "src/regexp/experimental/experimental-interpreter.h"
#include "src/regexp/regexp-parser.h"
#include "src/utils/ostreams.h"
namespace v8::internal {
bool ExperimentalRegExp::CanBeHandled(RegExpTree* tree, Handle<String> pattern,
RegExpFlags flags, int capture_count) { … }
void ExperimentalRegExp::Initialize(Isolate* isolate, DirectHandle<JSRegExp> re,
DirectHandle<String> source,
RegExpFlags flags, int capture_count) { … }
bool ExperimentalRegExp::IsCompiled(DirectHandle<IrRegExpData> re_data,
Isolate* isolate) { … }
template <class T>
Handle<TrustedByteArray> VectorToByteArray(Isolate* isolate,
base::Vector<T> data) { … }
namespace {
struct CompilationResult { … };
std::optional<CompilationResult> CompileImpl(
Isolate* isolate, DirectHandle<IrRegExpData> re_data) { … }
}
bool ExperimentalRegExp::Compile(Isolate* isolate,
DirectHandle<IrRegExpData> re_data) { … }
base::Vector<RegExpInstruction> AsInstructionSequence(
Tagged<TrustedByteArray> raw_bytes) { … }
namespace {
int32_t ExecRawImpl(Isolate* isolate, RegExp::CallOrigin call_origin,
Tagged<TrustedByteArray> bytecode, Tagged<String> subject,
int capture_count, int32_t* output_registers,
int32_t output_register_count, int32_t subject_index) { … }
}
int32_t ExperimentalRegExp::ExecRaw(Isolate* isolate,
RegExp::CallOrigin call_origin,
Tagged<IrRegExpData> regexp_data,
Tagged<String> subject,
int32_t* output_registers,
int32_t output_register_count,
int32_t subject_index) { … }
int32_t ExperimentalRegExp::MatchForCallFromJs(
Address subject, int32_t start_position, Address input_start,
Address input_end, int* output_registers, int32_t output_register_count,
RegExp::CallOrigin call_origin, Isolate* isolate, Address regexp_data) { … }
MaybeHandle<Object> ExperimentalRegExp::Exec(
Isolate* isolate, DirectHandle<IrRegExpData> regexp_data,
Handle<String> subject, int subject_index,
Handle<RegExpMatchInfo> last_match_info, RegExp::ExecQuirks exec_quirks) { … }
int32_t ExperimentalRegExp::OneshotExecRaw(
Isolate* isolate, DirectHandle<IrRegExpData> regexp_data,
DirectHandle<String> subject, int32_t* output_registers,
int32_t output_register_count, int32_t subject_index) { … }
MaybeHandle<Object> ExperimentalRegExp::OneshotExec(
Isolate* isolate, DirectHandle<IrRegExpData> regexp_data,
DirectHandle<String> subject, int subject_index,
Handle<RegExpMatchInfo> last_match_info, RegExp::ExecQuirks exec_quirks) { … }
}