v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
regexp-match-info-inl.h
Go to the documentation of this file.
1// Copyright 2021 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_OBJECTS_REGEXP_MATCH_INFO_INL_H_
6#define V8_OBJECTS_REGEXP_MATCH_INFO_INL_H_
7
9// Include the non-inl header before the rest of the headers.
10
12
13// Has to be the last include (doesn't have include guards):
15
16namespace v8 {
17namespace internal {
18
20 return number_of_capture_registers_.load().value();
21}
23 number_of_capture_registers_.store(this, Smi::FromInt(value));
24}
25
27 return last_subject_.load();
28}
30 WriteBarrierMode mode) {
31 last_subject_.store(this, value, mode);
32}
33
35 return last_input_.load();
36}
38 WriteBarrierMode mode) {
39 last_input_.store(this, value, mode);
40}
41
42int RegExpMatchInfo::capture(int index) const { return get(index).value(); }
43
44void RegExpMatchInfo::set_capture(int index, int value) {
45 set(index, Smi::FromInt(value));
46}
47
48} // namespace internal
49} // namespace v8
50
52
53#endif // V8_OBJECTS_REGEXP_MATCH_INFO_INL_H_
void set_last_input(Tagged< Object > value, WriteBarrierMode mode=UPDATE_WRITE_BARRIER)
Tagged< Object > last_input() const
void set_capture(int index, int value)
void set_last_subject(Tagged< String > value, WriteBarrierMode mode=UPDATE_WRITE_BARRIER)
Tagged< String > last_subject() const
static constexpr Tagged< Smi > FromInt(int value)
Definition smi.h:38
void set(int index, Tagged< ElementT > value, WriteBarrierMode mode=kDefaultMode)