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_LIST_FORMAT_INL_H_
10 : #define V8_OBJECTS_JS_LIST_FORMAT_INL_H_
11 :
12 : #include "src/objects-inl.h"
13 : #include "src/objects/js-list-format.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(JSListFormat, JSObject)
22 :
23 : // Base list format accessors.
24 5335 : ACCESSORS(JSListFormat, locale, String, kLocaleOffset)
25 8154 : ACCESSORS(JSListFormat, icu_formatter, Managed<icu::ListFormatter>,
26 : kICUFormatterOffset)
27 4551 : SMI_ACCESSORS(JSListFormat, flags, kFlagsOffset)
28 :
29 900 : inline void JSListFormat::set_style(Style style) {
30 : DCHECK_GT(Style::COUNT, style);
31 : int hints = flags();
32 1800 : hints = StyleBits::update(hints, style);
33 : set_flags(hints);
34 900 : }
35 :
36 : inline JSListFormat::Style JSListFormat::style() const {
37 315 : return StyleBits::decode(flags());
38 : }
39 :
40 995 : inline void JSListFormat::set_type(Type type) {
41 : DCHECK_GT(Type::COUNT, type);
42 : int hints = flags();
43 1990 : hints = TypeBits::update(hints, type);
44 : set_flags(hints);
45 995 : }
46 :
47 : inline JSListFormat::Type JSListFormat::type() const {
48 315 : return TypeBits::decode(flags());
49 : }
50 :
51 : CAST_ACCESSOR(JSListFormat)
52 :
53 : } // namespace internal
54 : } // namespace v8
55 :
56 : #include "src/objects/object-macros-undef.h"
57 :
58 : #endif // V8_OBJECTS_JS_LIST_FORMAT_INL_H_
|