v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
js-segments-inl.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_OBJECTS_JS_SEGMENTS_INL_H_
6#define V8_OBJECTS_JS_SEGMENTS_INL_H_
7
8#ifndef V8_INTL_SUPPORT
9#error Internationalization is expected to be enabled.
10#endif // V8_INTL_SUPPORT
11
13// Include the non-inl header before the rest of the headers.
14
16
17// Has to be the last include (doesn't have include guards):
19
20namespace v8 {
21namespace internal {
22
23#include "torque-generated/src/objects/js-segments-tq-inl.inc"
24
26
27// Base segments accessors.
28ACCESSORS(JSSegments, icu_break_iterator, Tagged<Managed<icu::BreakIterator>>,
29 kIcuBreakIteratorOffset)
30ACCESSORS(JSSegments, raw_string, Tagged<String>, kRawStringOffset)
31ACCESSORS(JSSegments, unicode_string, Tagged<Managed<icu::UnicodeString>>,
32 kUnicodeStringOffset)
33
34inline void JSSegments::set_granularity(JSSegmenter::Granularity granularity) {
35 DCHECK(GranularityBits::is_valid(granularity));
36 int hints = flags();
37 hints = GranularityBits::update(hints, granularity);
38 set_flags(hints);
39}
40
42 return GranularityBits::decode(flags());
43}
44
45} // namespace internal
46} // namespace v8
47
49
50#endif // V8_OBJECTS_JS_SEGMENTS_INL_H_
JSSegmenter::Granularity granularity() const
Flag flags[]
Definition flags.cc:3797
#define ACCESSORS(holder, name, type, offset)
#define TQ_OBJECT_CONSTRUCTORS_IMPL(Type)
#define DCHECK(condition)
Definition logging.h:482