11cb0ef41Sopenharmony_ci// Copyright 2019 the V8 project authors. All rights reserved.
21cb0ef41Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be
31cb0ef41Sopenharmony_ci// found in the LICENSE file.
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ci#ifndef V8_INTL_SUPPORT
61cb0ef41Sopenharmony_ci#error Internationalization is expected to be enabled.
71cb0ef41Sopenharmony_ci#endif  // V8_INTL_SUPPORT
81cb0ef41Sopenharmony_ci
91cb0ef41Sopenharmony_ci#ifndef V8_OBJECTS_JS_DISPLAY_NAMES_INL_H_
101cb0ef41Sopenharmony_ci#define V8_OBJECTS_JS_DISPLAY_NAMES_INL_H_
111cb0ef41Sopenharmony_ci
121cb0ef41Sopenharmony_ci#include "src/objects/js-display-names.h"
131cb0ef41Sopenharmony_ci#include "src/objects/objects-inl.h"
141cb0ef41Sopenharmony_ci
151cb0ef41Sopenharmony_ci// Has to be the last include (doesn't have include guards):
161cb0ef41Sopenharmony_ci#include "src/objects/object-macros.h"
171cb0ef41Sopenharmony_ci
181cb0ef41Sopenharmony_cinamespace v8 {
191cb0ef41Sopenharmony_cinamespace internal {
201cb0ef41Sopenharmony_ci
211cb0ef41Sopenharmony_ci#include "torque-generated/src/objects/js-display-names-tq-inl.inc"
221cb0ef41Sopenharmony_ci
231cb0ef41Sopenharmony_ciACCESSORS(JSDisplayNames, internal, Managed<DisplayNamesInternal>,
241cb0ef41Sopenharmony_ci          kInternalOffset)
251cb0ef41Sopenharmony_ciTQ_OBJECT_CONSTRUCTORS_IMPL(JSDisplayNames)
261cb0ef41Sopenharmony_ci
271cb0ef41Sopenharmony_ciinline void JSDisplayNames::set_style(Style style) {
281cb0ef41Sopenharmony_ci  DCHECK_GE(StyleBits::kMax, style);
291cb0ef41Sopenharmony_ci  set_flags(StyleBits::update(flags(), style));
301cb0ef41Sopenharmony_ci}
311cb0ef41Sopenharmony_ci
321cb0ef41Sopenharmony_ciinline JSDisplayNames::Style JSDisplayNames::style() const {
331cb0ef41Sopenharmony_ci  return StyleBits::decode(flags());
341cb0ef41Sopenharmony_ci}
351cb0ef41Sopenharmony_ci
361cb0ef41Sopenharmony_ciinline void JSDisplayNames::set_fallback(Fallback fallback) {
371cb0ef41Sopenharmony_ci  DCHECK_GE(FallbackBit::kMax, fallback);
381cb0ef41Sopenharmony_ci  set_flags(FallbackBit::update(flags(), fallback));
391cb0ef41Sopenharmony_ci}
401cb0ef41Sopenharmony_ci
411cb0ef41Sopenharmony_ciinline JSDisplayNames::Fallback JSDisplayNames::fallback() const {
421cb0ef41Sopenharmony_ci  return FallbackBit::decode(flags());
431cb0ef41Sopenharmony_ci}
441cb0ef41Sopenharmony_ci
451cb0ef41Sopenharmony_ciinline void JSDisplayNames::set_language_display(
461cb0ef41Sopenharmony_ci    LanguageDisplay language_display) {
471cb0ef41Sopenharmony_ci  DCHECK_GE(LanguageDisplayBit::kMax, language_display);
481cb0ef41Sopenharmony_ci  set_flags(LanguageDisplayBit::update(flags(), language_display));
491cb0ef41Sopenharmony_ci}
501cb0ef41Sopenharmony_ci
511cb0ef41Sopenharmony_ciinline JSDisplayNames::LanguageDisplay JSDisplayNames::language_display()
521cb0ef41Sopenharmony_ci    const {
531cb0ef41Sopenharmony_ci  return LanguageDisplayBit::decode(flags());
541cb0ef41Sopenharmony_ci}
551cb0ef41Sopenharmony_ci}  // namespace internal
561cb0ef41Sopenharmony_ci}  // namespace v8
571cb0ef41Sopenharmony_ci
581cb0ef41Sopenharmony_ci#include "src/objects/object-macros-undef.h"
591cb0ef41Sopenharmony_ci
601cb0ef41Sopenharmony_ci#endif  // V8_OBJECTS_JS_DISPLAY_NAMES_INL_H_
61