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_COLLATOR_INL_H_
10 #define V8_OBJECTS_JS_COLLATOR_INL_H_
11
12 #include "src/objects-inl.h"
13 #include "src/objects/js-collator.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 ACCESSORS(JSCollator, icu_collator, Managed<icu::Collator>, kICUCollatorOffset)
22 ACCESSORS(JSCollator, bound_compare, Object, kBoundCompareOffset);
SMI_ACCESSORS(JSCollator,flags,kFlagsOffset)23 SMI_ACCESSORS(JSCollator, flags, kFlagsOffset)
24
25 inline void JSCollator::set_usage(Usage usage) {
26 DCHECK_LT(usage, Usage::COUNT);
27 int hints = flags();
28 hints = UsageBits::update(hints, usage);
29 set_flags(hints);
30 }
31
usage()32 inline JSCollator::Usage JSCollator::usage() const {
33 return UsageBits::decode(flags());
34 }
35
36 CAST_ACCESSOR(JSCollator);
37
38 } // namespace internal
39 } // namespace v8
40
41 #include "src/objects/object-macros-undef.h"
42
43 #endif // V8_OBJECTS_JS_COLLATOR_INL_H_
44