v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
experimental-compiler.h
Go to the documentation of this file.
1// Copyright 2020 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_REGEXP_EXPERIMENTAL_EXPERIMENTAL_COMPILER_H_
6#define V8_REGEXP_EXPERIMENTAL_EXPERIMENTAL_COMPILER_H_
7
11#include "src/zone/zone-list.h"
12
13namespace v8 {
14namespace internal {
15
17 public:
18 // Checks whether a given RegExpTree can be compiled into an experimental
19 // bytecode program. This mostly amounts to the absence of back references,
20 // but see the definition.
21 // TODO(mbid,v8:10765): Currently more things are not handled, e.g. some
22 // quantifiers and unicode.
23 static bool CanBeHandled(RegExpTree* tree, RegExpFlags flags,
24 int capture_count);
25 // Compile regexp into a bytecode program. The regexp must be handlable by
26 // the experimental engine; see`CanBeHandled`. The program is returned as a
27 // ZoneList backed by the same Zone that is used in the RegExpTree argument.
29 RegExpFlags flags, Zone* zone);
30};
31
32} // namespace internal
33} // namespace v8
34
35#endif // V8_REGEXP_EXPERIMENTAL_EXPERIMENTAL_COMPILER_H_
static ZoneList< RegExpInstruction > Compile(RegExpTree *tree, RegExpFlags flags, Zone *zone)
static bool CanBeHandled(RegExpTree *tree, RegExpFlags flags, int capture_count)