• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/api-inl.h"
13 #include "src/objects/js-plural-rules.h"
14 #include "src/objects/objects-inl.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 #include "torque-generated/src/objects/js-plural-rules-tq-inl.inc"
23 
24 TQ_OBJECT_CONSTRUCTORS_IMPL(JSPluralRules)
25 
ACCESSORS(JSPluralRules,icu_plural_rules,Managed<icu::PluralRules>,kIcuPluralRulesOffset)26 ACCESSORS(JSPluralRules, icu_plural_rules, Managed<icu::PluralRules>,
27           kIcuPluralRulesOffset)
28 ACCESSORS(JSPluralRules, icu_number_formatter,
29           Managed<icu::number::LocalizedNumberFormatter>,
30           kIcuNumberFormatterOffset)
31 
32 inline void JSPluralRules::set_type(Type type) {
33   DCHECK_LE(type, TypeBit::kMax);
34   int hints = flags();
35   hints = TypeBit::update(hints, type);
36   set_flags(hints);
37 }
38 
type()39 inline JSPluralRules::Type JSPluralRules::type() const {
40   return TypeBit::decode(flags());
41 }
42 
43 }  // namespace internal
44 }  // namespace v8
45 
46 #include "src/objects/object-macros-undef.h"
47 
48 #endif  // V8_OBJECTS_JS_PLURAL_RULES_INL_H_
49