• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2019 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_DISPLAY_NAMES_INL_H_
10 #define V8_OBJECTS_JS_DISPLAY_NAMES_INL_H_
11 
12 #include "src/objects/js-display-names.h"
13 #include "src/objects/objects-inl.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 #include "torque-generated/src/objects/js-display-names-tq-inl.inc"
22 
ACCESSORS(JSDisplayNames,internal,Managed<DisplayNamesInternal>,kInternalOffset)23 ACCESSORS(JSDisplayNames, internal, Managed<DisplayNamesInternal>,
24           kInternalOffset)
25 TQ_OBJECT_CONSTRUCTORS_IMPL(JSDisplayNames)
26 
27 inline void JSDisplayNames::set_style(Style style) {
28   DCHECK_GE(StyleBits::kMax, style);
29   set_flags(StyleBits::update(flags(), style));
30 }
31 
style()32 inline JSDisplayNames::Style JSDisplayNames::style() const {
33   return StyleBits::decode(flags());
34 }
35 
set_fallback(Fallback fallback)36 inline void JSDisplayNames::set_fallback(Fallback fallback) {
37   DCHECK_GE(FallbackBit::kMax, fallback);
38   int hints = flags();
39   hints = FallbackBit::update(hints, fallback);
40   set_flags(hints);
41 }
42 
fallback()43 inline JSDisplayNames::Fallback JSDisplayNames::fallback() const {
44   return FallbackBit::decode(flags());
45 }
46 
47 }  // namespace internal
48 }  // namespace v8
49 
50 #include "src/objects/object-macros-undef.h"
51 
52 #endif  // V8_OBJECTS_JS_DISPLAY_NAMES_INL_H_
53