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_PLURAL_RULES_INL_H_
10 : #define V8_OBJECTS_JS_PLURAL_RULES_INL_H_
11 :
12 : #include "src/api-inl.h"
13 : #include "src/objects-inl.h"
14 : #include "src/objects/js-plural-rules.h"
15 :
16 : // Has to be the last include (doesn't have include guards):
17 : #include "src/objects/object-macros.h"
18 :
19 : namespace v8 {
20 : namespace internal {
21 :
22 : OBJECT_CONSTRUCTORS_IMPL(JSPluralRules, JSObject)
23 :
24 225 : ACCESSORS(JSPluralRules, locale, String, kLocaleOffset)
25 135 : SMI_ACCESSORS(JSPluralRules, flags, kFlagsOffset)
26 603 : ACCESSORS(JSPluralRules, icu_plural_rules, Managed<icu::PluralRules>,
27 : kICUPluralRulesOffset)
28 603 : ACCESSORS(JSPluralRules, icu_decimal_format, Managed<icu::DecimalFormat>,
29 : kICUDecimalFormatOffset)
30 :
31 45 : inline void JSPluralRules::set_type(Type type) {
32 : DCHECK_LT(type, Type::COUNT);
33 : int hints = flags();
34 90 : hints = TypeBits::update(hints, type);
35 : set_flags(hints);
36 45 : }
37 :
38 : inline JSPluralRules::Type JSPluralRules::type() const {
39 0 : return TypeBits::decode(flags());
40 : }
41 :
42 : CAST_ACCESSOR(JSPluralRules)
43 :
44 : } // namespace internal
45 : } // namespace v8
46 :
47 : #include "src/objects/object-macros-undef.h"
48 :
49 : #endif // V8_OBJECTS_JS_PLURAL_RULES_INL_H_
|