Line data Source code
1 : // Copyright 2018 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_INTL_SUPPORT
6 : #error Internationalization is expected to be enabled.
7 : #endif // V8_INTL_SUPPORT
8 :
9 : #ifndef V8_OBJECTS_JS_BREAK_ITERATOR_INL_H_
10 : #define V8_OBJECTS_JS_BREAK_ITERATOR_INL_H_
11 :
12 : #include "src/objects-inl.h"
13 : #include "src/objects/js-break-iterator.h"
14 :
15 : // Has to be the last include (doesn't have include guards):
16 : #include "src/objects/object-macros.h"
17 :
18 : namespace v8 {
19 : namespace internal {
20 :
21 : OBJECT_CONSTRUCTORS_IMPL(JSV8BreakIterator, JSObject)
22 :
23 : inline void JSV8BreakIterator::set_type(Type type) {
24 : DCHECK_GT(JSV8BreakIterator::Type::COUNT, type);
25 248 : WRITE_FIELD(*this, kTypeOffset, Smi::FromInt(static_cast<int>(type)));
26 : }
27 :
28 : inline JSV8BreakIterator::Type JSV8BreakIterator::type() const {
29 72 : Object value = READ_FIELD(*this, kTypeOffset);
30 : return static_cast<JSV8BreakIterator::Type>(Smi::ToInt(value));
31 : }
32 :
33 1312 : ACCESSORS(JSV8BreakIterator, locale, String, kLocaleOffset)
34 2011 : ACCESSORS(JSV8BreakIterator, break_iterator, Managed<icu::BreakIterator>,
35 : kBreakIteratorOffset)
36 1445 : ACCESSORS(JSV8BreakIterator, unicode_string, Managed<icu::UnicodeString>,
37 : kUnicodeStringOffset)
38 246 : ACCESSORS(JSV8BreakIterator, bound_adopt_text, Object, kBoundAdoptTextOffset)
39 216 : ACCESSORS(JSV8BreakIterator, bound_first, Object, kBoundFirstOffset)
40 674 : ACCESSORS(JSV8BreakIterator, bound_next, Object, kBoundNextOffset)
41 0 : ACCESSORS(JSV8BreakIterator, bound_current, Object, kBoundCurrentOffset)
42 369 : ACCESSORS(JSV8BreakIterator, bound_break_type, Object, kBoundBreakTypeOffset)
43 :
44 : CAST_ACCESSOR(JSV8BreakIterator)
45 :
46 : } // namespace internal
47 : } // namespace v8
48 :
49 : #include "src/objects/object-macros-undef.h"
50 :
51 : #endif // V8_OBJECTS_JS_BREAK_ITERATOR_INL_H_
|