11cb0ef41Sopenharmony_ci// Copyright 2017 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_OBJECTS_DATA_HANDLER_H_
61cb0ef41Sopenharmony_ci#define V8_OBJECTS_DATA_HANDLER_H_
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_ci#include "src/objects/struct.h"
91cb0ef41Sopenharmony_ci
101cb0ef41Sopenharmony_ci// Has to be the last include (doesn't have include guards):
111cb0ef41Sopenharmony_ci#include "src/objects/object-macros.h"
121cb0ef41Sopenharmony_ci
131cb0ef41Sopenharmony_cinamespace v8 {
141cb0ef41Sopenharmony_cinamespace internal {
151cb0ef41Sopenharmony_ci
161cb0ef41Sopenharmony_ci#include "torque-generated/src/objects/data-handler-tq.inc"
171cb0ef41Sopenharmony_ci
181cb0ef41Sopenharmony_ci// DataHandler is a base class for load and store handlers that can't be
191cb0ef41Sopenharmony_ci// encoded in one Smi. Kind of a handler can be deduced from instance type.
201cb0ef41Sopenharmony_ciclass DataHandler : public TorqueGeneratedDataHandler<DataHandler, Struct> {
211cb0ef41Sopenharmony_ci public:
221cb0ef41Sopenharmony_ci  // Returns number of optional data fields available in the object.
231cb0ef41Sopenharmony_ci  inline int data_field_count() const;
241cb0ef41Sopenharmony_ci
251cb0ef41Sopenharmony_ci  // [data1-3]: These are optional general-purpose fields whose content and
261cb0ef41Sopenharmony_ci  // presence depends on the handler kind.
271cb0ef41Sopenharmony_ci  DECL_ACCESSORS(data1, MaybeObject)
281cb0ef41Sopenharmony_ci  DECL_ACCESSORS(data2, MaybeObject)
291cb0ef41Sopenharmony_ci  DECL_ACCESSORS(data3, MaybeObject)
301cb0ef41Sopenharmony_ci
311cb0ef41Sopenharmony_ci  static const int kSizeWithData0 = kData1Offset;
321cb0ef41Sopenharmony_ci  static const int kSizeWithData1 = kData2Offset;
331cb0ef41Sopenharmony_ci  static const int kSizeWithData2 = kData3Offset;
341cb0ef41Sopenharmony_ci  static const int kSizeWithData3 = kHeaderSize;
351cb0ef41Sopenharmony_ci
361cb0ef41Sopenharmony_ci  DECL_VERIFIER(DataHandler)
371cb0ef41Sopenharmony_ci
381cb0ef41Sopenharmony_ci  class BodyDescriptor;
391cb0ef41Sopenharmony_ci
401cb0ef41Sopenharmony_ci  TQ_OBJECT_CONSTRUCTORS(DataHandler)
411cb0ef41Sopenharmony_ci};
421cb0ef41Sopenharmony_ci
431cb0ef41Sopenharmony_ci}  // namespace internal
441cb0ef41Sopenharmony_ci}  // namespace v8
451cb0ef41Sopenharmony_ci
461cb0ef41Sopenharmony_ci#include "src/objects/object-macros-undef.h"
471cb0ef41Sopenharmony_ci
481cb0ef41Sopenharmony_ci#endif  // V8_OBJECTS_DATA_HANDLER_H_
49