11cb0ef41Sopenharmony_ci// Copyright 2014 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_COMPILER_SIMPLIFIED_OPERATOR_H_
61cb0ef41Sopenharmony_ci#define V8_COMPILER_SIMPLIFIED_OPERATOR_H_
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_ci#include <iosfwd>
91cb0ef41Sopenharmony_ci
101cb0ef41Sopenharmony_ci#include "src/base/compiler-specific.h"
111cb0ef41Sopenharmony_ci#include "src/codegen/machine-type.h"
121cb0ef41Sopenharmony_ci#include "src/codegen/tnode.h"
131cb0ef41Sopenharmony_ci#include "src/common/globals.h"
141cb0ef41Sopenharmony_ci#include "src/compiler/common-operator.h"
151cb0ef41Sopenharmony_ci#include "src/compiler/feedback-source.h"
161cb0ef41Sopenharmony_ci#include "src/compiler/node-properties.h"
171cb0ef41Sopenharmony_ci#include "src/compiler/operator.h"
181cb0ef41Sopenharmony_ci#include "src/compiler/types.h"
191cb0ef41Sopenharmony_ci#include "src/compiler/write-barrier-kind.h"
201cb0ef41Sopenharmony_ci#include "src/deoptimizer/deoptimize-reason.h"
211cb0ef41Sopenharmony_ci#include "src/handles/handles.h"
221cb0ef41Sopenharmony_ci#include "src/handles/maybe-handles.h"
231cb0ef41Sopenharmony_ci#include "src/objects/objects.h"
241cb0ef41Sopenharmony_ci#include "src/objects/type-hints.h"
251cb0ef41Sopenharmony_ci#include "src/zone/zone-handle-set.h"
261cb0ef41Sopenharmony_ci
271cb0ef41Sopenharmony_cinamespace v8 {
281cb0ef41Sopenharmony_ciclass CFunctionInfo;
291cb0ef41Sopenharmony_ci
301cb0ef41Sopenharmony_cinamespace internal {
311cb0ef41Sopenharmony_ci
321cb0ef41Sopenharmony_ci// Forward declarations.
331cb0ef41Sopenharmony_cienum class AbortReason : uint8_t;
341cb0ef41Sopenharmony_ciclass Zone;
351cb0ef41Sopenharmony_ci
361cb0ef41Sopenharmony_cinamespace compiler {
371cb0ef41Sopenharmony_ci
381cb0ef41Sopenharmony_ci// Forward declarations.
391cb0ef41Sopenharmony_ciclass Operator;
401cb0ef41Sopenharmony_cistruct SimplifiedOperatorGlobalCache;
411cb0ef41Sopenharmony_ciclass CallDescriptor;
421cb0ef41Sopenharmony_ci
431cb0ef41Sopenharmony_cienum BaseTaggedness : uint8_t { kUntaggedBase, kTaggedBase };
441cb0ef41Sopenharmony_ci
451cb0ef41Sopenharmony_cisize_t hash_value(BaseTaggedness);
461cb0ef41Sopenharmony_ci
471cb0ef41Sopenharmony_cistd::ostream& operator<<(std::ostream&, BaseTaggedness);
481cb0ef41Sopenharmony_ci
491cb0ef41Sopenharmony_cistruct ConstFieldInfo {
501cb0ef41Sopenharmony_ci  // the map that introduced the const field, if any. An access is considered
511cb0ef41Sopenharmony_ci  // mutable iff the handle is null.
521cb0ef41Sopenharmony_ci  MaybeHandle<Map> owner_map;
531cb0ef41Sopenharmony_ci
541cb0ef41Sopenharmony_ci  ConstFieldInfo() : owner_map(MaybeHandle<Map>()) {}
551cb0ef41Sopenharmony_ci  explicit ConstFieldInfo(Handle<Map> owner_map) : owner_map(owner_map) {}
561cb0ef41Sopenharmony_ci
571cb0ef41Sopenharmony_ci  bool IsConst() const { return !owner_map.is_null(); }
581cb0ef41Sopenharmony_ci
591cb0ef41Sopenharmony_ci  // No const field owner, i.e., a mutable field
601cb0ef41Sopenharmony_ci  static ConstFieldInfo None() { return ConstFieldInfo(); }
611cb0ef41Sopenharmony_ci};
621cb0ef41Sopenharmony_ci
631cb0ef41Sopenharmony_ciV8_EXPORT_PRIVATE bool operator==(ConstFieldInfo const&, ConstFieldInfo const&);
641cb0ef41Sopenharmony_ci
651cb0ef41Sopenharmony_cisize_t hash_value(ConstFieldInfo const&);
661cb0ef41Sopenharmony_ci
671cb0ef41Sopenharmony_ciV8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&,
681cb0ef41Sopenharmony_ci                                           ConstFieldInfo const&);
691cb0ef41Sopenharmony_ci
701cb0ef41Sopenharmony_ci// An access descriptor for loads/stores of fixed structures like field
711cb0ef41Sopenharmony_ci// accesses of heap objects. Accesses from either tagged or untagged base
721cb0ef41Sopenharmony_ci// pointers are supported; untagging is done automatically during lowering.
731cb0ef41Sopenharmony_cistruct FieldAccess {
741cb0ef41Sopenharmony_ci  BaseTaggedness base_is_tagged;  // specifies if the base pointer is tagged.
751cb0ef41Sopenharmony_ci  int offset;                     // offset of the field, without tag.
761cb0ef41Sopenharmony_ci  MaybeHandle<Name> name;         // debugging only.
771cb0ef41Sopenharmony_ci  MaybeHandle<Map> map;           // map of the field value (if known).
781cb0ef41Sopenharmony_ci  Type type;                      // type of the field.
791cb0ef41Sopenharmony_ci  MachineType machine_type;       // machine type of the field.
801cb0ef41Sopenharmony_ci  WriteBarrierKind write_barrier_kind;  // write barrier hint.
811cb0ef41Sopenharmony_ci  ConstFieldInfo const_field_info;      // the constness of this access, and the
821cb0ef41Sopenharmony_ci                                    // field owner map, if the access is const
831cb0ef41Sopenharmony_ci  bool is_store_in_literal;  // originates from a kStoreInLiteral access
841cb0ef41Sopenharmony_ci#ifdef V8_SANDBOXED_EXTERNAL_POINTERS
851cb0ef41Sopenharmony_ci  ExternalPointerTag external_pointer_tag = kExternalPointerNullTag;
861cb0ef41Sopenharmony_ci#endif
871cb0ef41Sopenharmony_ci  bool maybe_initializing_or_transitioning_store;  // store is potentially
881cb0ef41Sopenharmony_ci                                                   // initializing a newly
891cb0ef41Sopenharmony_ci                                                   // allocated object or part
901cb0ef41Sopenharmony_ci                                                   // of a map transition.
911cb0ef41Sopenharmony_ci
921cb0ef41Sopenharmony_ci  FieldAccess()
931cb0ef41Sopenharmony_ci      : base_is_tagged(kTaggedBase),
941cb0ef41Sopenharmony_ci        offset(0),
951cb0ef41Sopenharmony_ci        type(Type::None()),
961cb0ef41Sopenharmony_ci        machine_type(MachineType::None()),
971cb0ef41Sopenharmony_ci        write_barrier_kind(kFullWriteBarrier),
981cb0ef41Sopenharmony_ci        const_field_info(ConstFieldInfo::None()),
991cb0ef41Sopenharmony_ci        is_store_in_literal(false),
1001cb0ef41Sopenharmony_ci        maybe_initializing_or_transitioning_store(false) {}
1011cb0ef41Sopenharmony_ci
1021cb0ef41Sopenharmony_ci  FieldAccess(BaseTaggedness base_is_tagged, int offset, MaybeHandle<Name> name,
1031cb0ef41Sopenharmony_ci              MaybeHandle<Map> map, Type type, MachineType machine_type,
1041cb0ef41Sopenharmony_ci              WriteBarrierKind write_barrier_kind,
1051cb0ef41Sopenharmony_ci              ConstFieldInfo const_field_info = ConstFieldInfo::None(),
1061cb0ef41Sopenharmony_ci              bool is_store_in_literal = false,
1071cb0ef41Sopenharmony_ci#ifdef V8_SANDBOXED_EXTERNAL_POINTERS
1081cb0ef41Sopenharmony_ci              ExternalPointerTag external_pointer_tag = kExternalPointerNullTag,
1091cb0ef41Sopenharmony_ci#endif
1101cb0ef41Sopenharmony_ci              bool maybe_initializing_or_transitioning_store = false)
1111cb0ef41Sopenharmony_ci      : base_is_tagged(base_is_tagged),
1121cb0ef41Sopenharmony_ci        offset(offset),
1131cb0ef41Sopenharmony_ci        name(name),
1141cb0ef41Sopenharmony_ci        map(map),
1151cb0ef41Sopenharmony_ci        type(type),
1161cb0ef41Sopenharmony_ci        machine_type(machine_type),
1171cb0ef41Sopenharmony_ci        write_barrier_kind(write_barrier_kind),
1181cb0ef41Sopenharmony_ci        const_field_info(const_field_info),
1191cb0ef41Sopenharmony_ci        is_store_in_literal(is_store_in_literal),
1201cb0ef41Sopenharmony_ci#ifdef V8_SANDBOXED_EXTERNAL_POINTERS
1211cb0ef41Sopenharmony_ci        external_pointer_tag(external_pointer_tag),
1221cb0ef41Sopenharmony_ci#endif
1231cb0ef41Sopenharmony_ci        maybe_initializing_or_transitioning_store(
1241cb0ef41Sopenharmony_ci            maybe_initializing_or_transitioning_store) {
1251cb0ef41Sopenharmony_ci    DCHECK_GE(offset, 0);
1261cb0ef41Sopenharmony_ci    DCHECK_IMPLIES(
1271cb0ef41Sopenharmony_ci        machine_type.IsMapWord(),
1281cb0ef41Sopenharmony_ci        offset == HeapObject::kMapOffset && base_is_tagged != kUntaggedBase);
1291cb0ef41Sopenharmony_ci    DCHECK_IMPLIES(machine_type.IsMapWord(),
1301cb0ef41Sopenharmony_ci                   (write_barrier_kind == kMapWriteBarrier ||
1311cb0ef41Sopenharmony_ci                    write_barrier_kind == kNoWriteBarrier ||
1321cb0ef41Sopenharmony_ci                    write_barrier_kind == kAssertNoWriteBarrier));
1331cb0ef41Sopenharmony_ci  }
1341cb0ef41Sopenharmony_ci
1351cb0ef41Sopenharmony_ci  int tag() const { return base_is_tagged == kTaggedBase ? kHeapObjectTag : 0; }
1361cb0ef41Sopenharmony_ci};
1371cb0ef41Sopenharmony_ci
1381cb0ef41Sopenharmony_ciV8_EXPORT_PRIVATE bool operator==(FieldAccess const&, FieldAccess const&);
1391cb0ef41Sopenharmony_ci
1401cb0ef41Sopenharmony_cisize_t hash_value(FieldAccess const&);
1411cb0ef41Sopenharmony_ci
1421cb0ef41Sopenharmony_ciV8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, FieldAccess const&);
1431cb0ef41Sopenharmony_ci
1441cb0ef41Sopenharmony_ciV8_EXPORT_PRIVATE FieldAccess const& FieldAccessOf(const Operator* op)
1451cb0ef41Sopenharmony_ci    V8_WARN_UNUSED_RESULT;
1461cb0ef41Sopenharmony_ci
1471cb0ef41Sopenharmony_citemplate <>
1481cb0ef41Sopenharmony_civoid Operator1<FieldAccess>::PrintParameter(std::ostream& os,
1491cb0ef41Sopenharmony_ci                                            PrintVerbosity verbose) const;
1501cb0ef41Sopenharmony_ci
1511cb0ef41Sopenharmony_ci// An access descriptor for loads/stores of indexed structures like characters
1521cb0ef41Sopenharmony_ci// in strings or off-heap backing stores. Accesses from either tagged or
1531cb0ef41Sopenharmony_ci// untagged base pointers are supported; untagging is done automatically during
1541cb0ef41Sopenharmony_ci// lowering.
1551cb0ef41Sopenharmony_cistruct ElementAccess {
1561cb0ef41Sopenharmony_ci  BaseTaggedness base_is_tagged;  // specifies if the base pointer is tagged.
1571cb0ef41Sopenharmony_ci  int header_size;                // size of the header, without tag.
1581cb0ef41Sopenharmony_ci  Type type;                      // type of the element.
1591cb0ef41Sopenharmony_ci  MachineType machine_type;       // machine type of the element.
1601cb0ef41Sopenharmony_ci  WriteBarrierKind write_barrier_kind;  // write barrier hint.
1611cb0ef41Sopenharmony_ci
1621cb0ef41Sopenharmony_ci  ElementAccess()
1631cb0ef41Sopenharmony_ci      : base_is_tagged(kTaggedBase),
1641cb0ef41Sopenharmony_ci        header_size(0),
1651cb0ef41Sopenharmony_ci        type(Type::None()),
1661cb0ef41Sopenharmony_ci        machine_type(MachineType::None()),
1671cb0ef41Sopenharmony_ci        write_barrier_kind(kFullWriteBarrier) {}
1681cb0ef41Sopenharmony_ci
1691cb0ef41Sopenharmony_ci  ElementAccess(BaseTaggedness base_is_tagged, int header_size, Type type,
1701cb0ef41Sopenharmony_ci                MachineType machine_type, WriteBarrierKind write_barrier_kind)
1711cb0ef41Sopenharmony_ci      : base_is_tagged(base_is_tagged),
1721cb0ef41Sopenharmony_ci        header_size(header_size),
1731cb0ef41Sopenharmony_ci        type(type),
1741cb0ef41Sopenharmony_ci        machine_type(machine_type),
1751cb0ef41Sopenharmony_ci        write_barrier_kind(write_barrier_kind) {}
1761cb0ef41Sopenharmony_ci
1771cb0ef41Sopenharmony_ci  int tag() const { return base_is_tagged == kTaggedBase ? kHeapObjectTag : 0; }
1781cb0ef41Sopenharmony_ci};
1791cb0ef41Sopenharmony_ci
1801cb0ef41Sopenharmony_ciV8_EXPORT_PRIVATE bool operator==(ElementAccess const&, ElementAccess const&);
1811cb0ef41Sopenharmony_ci
1821cb0ef41Sopenharmony_cisize_t hash_value(ElementAccess const&);
1831cb0ef41Sopenharmony_ci
1841cb0ef41Sopenharmony_ciV8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, ElementAccess const&);
1851cb0ef41Sopenharmony_ci
1861cb0ef41Sopenharmony_ciV8_EXPORT_PRIVATE ElementAccess const& ElementAccessOf(const Operator* op)
1871cb0ef41Sopenharmony_ci    V8_WARN_UNUSED_RESULT;
1881cb0ef41Sopenharmony_ci
1891cb0ef41Sopenharmony_ciExternalArrayType ExternalArrayTypeOf(const Operator* op) V8_WARN_UNUSED_RESULT;
1901cb0ef41Sopenharmony_ci
1911cb0ef41Sopenharmony_ci// An access descriptor for loads/stores of CSA-accessible structures.
1921cb0ef41Sopenharmony_cistruct ObjectAccess {
1931cb0ef41Sopenharmony_ci  MachineType machine_type;             // machine type of the field.
1941cb0ef41Sopenharmony_ci  WriteBarrierKind write_barrier_kind;  // write barrier hint.
1951cb0ef41Sopenharmony_ci
1961cb0ef41Sopenharmony_ci  ObjectAccess()
1971cb0ef41Sopenharmony_ci      : machine_type(MachineType::None()),
1981cb0ef41Sopenharmony_ci        write_barrier_kind(kFullWriteBarrier) {}
1991cb0ef41Sopenharmony_ci
2001cb0ef41Sopenharmony_ci  ObjectAccess(MachineType machine_type, WriteBarrierKind write_barrier_kind)
2011cb0ef41Sopenharmony_ci      : machine_type(machine_type), write_barrier_kind(write_barrier_kind) {}
2021cb0ef41Sopenharmony_ci
2031cb0ef41Sopenharmony_ci  int tag() const { return kHeapObjectTag; }
2041cb0ef41Sopenharmony_ci};
2051cb0ef41Sopenharmony_ci
2061cb0ef41Sopenharmony_ciV8_EXPORT_PRIVATE bool operator==(ObjectAccess const&, ObjectAccess const&);
2071cb0ef41Sopenharmony_ci
2081cb0ef41Sopenharmony_cisize_t hash_value(ObjectAccess const&);
2091cb0ef41Sopenharmony_ci
2101cb0ef41Sopenharmony_ciV8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, ObjectAccess const&);
2111cb0ef41Sopenharmony_ci
2121cb0ef41Sopenharmony_ciV8_EXPORT_PRIVATE ObjectAccess const& ObjectAccessOf(const Operator* op)
2131cb0ef41Sopenharmony_ci    V8_WARN_UNUSED_RESULT;
2141cb0ef41Sopenharmony_ci
2151cb0ef41Sopenharmony_ci// The ConvertReceiverMode is used as parameter by ConvertReceiver operators.
2161cb0ef41Sopenharmony_ciConvertReceiverMode ConvertReceiverModeOf(Operator const* op)
2171cb0ef41Sopenharmony_ci    V8_WARN_UNUSED_RESULT;
2181cb0ef41Sopenharmony_ci
2191cb0ef41Sopenharmony_ci// A the parameters for several Check nodes. The {feedback} parameter is
2201cb0ef41Sopenharmony_ci// optional. If {feedback} references a valid CallIC slot and this MapCheck
2211cb0ef41Sopenharmony_ci// fails, then speculation on that CallIC slot will be disabled.
2221cb0ef41Sopenharmony_ciclass CheckParameters final {
2231cb0ef41Sopenharmony_ci public:
2241cb0ef41Sopenharmony_ci  explicit CheckParameters(const FeedbackSource& feedback)
2251cb0ef41Sopenharmony_ci      : feedback_(feedback) {}
2261cb0ef41Sopenharmony_ci
2271cb0ef41Sopenharmony_ci  FeedbackSource const& feedback() const { return feedback_; }
2281cb0ef41Sopenharmony_ci
2291cb0ef41Sopenharmony_ci private:
2301cb0ef41Sopenharmony_ci  FeedbackSource feedback_;
2311cb0ef41Sopenharmony_ci};
2321cb0ef41Sopenharmony_ci
2331cb0ef41Sopenharmony_cibool operator==(CheckParameters const&, CheckParameters const&);
2341cb0ef41Sopenharmony_ci
2351cb0ef41Sopenharmony_cisize_t hash_value(CheckParameters const&);
2361cb0ef41Sopenharmony_ci
2371cb0ef41Sopenharmony_cistd::ostream& operator<<(std::ostream&, CheckParameters const&);
2381cb0ef41Sopenharmony_ci
2391cb0ef41Sopenharmony_ciCheckParameters const& CheckParametersOf(Operator const*) V8_WARN_UNUSED_RESULT;
2401cb0ef41Sopenharmony_ci
2411cb0ef41Sopenharmony_cienum class CheckBoundsFlag : uint8_t {
2421cb0ef41Sopenharmony_ci  kConvertStringAndMinusZero = 1 << 0,  // instead of deopting on such inputs
2431cb0ef41Sopenharmony_ci  kAbortOnOutOfBounds = 1 << 1,         // instead of deopting if input is OOB
2441cb0ef41Sopenharmony_ci};
2451cb0ef41Sopenharmony_ciusing CheckBoundsFlags = base::Flags<CheckBoundsFlag>;
2461cb0ef41Sopenharmony_ciDEFINE_OPERATORS_FOR_FLAGS(CheckBoundsFlags)
2471cb0ef41Sopenharmony_ci
2481cb0ef41Sopenharmony_ciclass CheckBoundsParameters final {
2491cb0ef41Sopenharmony_ci public:
2501cb0ef41Sopenharmony_ci  CheckBoundsParameters(const FeedbackSource& feedback, CheckBoundsFlags flags)
2511cb0ef41Sopenharmony_ci      : check_parameters_(feedback), flags_(flags) {}
2521cb0ef41Sopenharmony_ci
2531cb0ef41Sopenharmony_ci  CheckBoundsFlags flags() const { return flags_; }
2541cb0ef41Sopenharmony_ci  const CheckParameters& check_parameters() const { return check_parameters_; }
2551cb0ef41Sopenharmony_ci
2561cb0ef41Sopenharmony_ci private:
2571cb0ef41Sopenharmony_ci  CheckParameters check_parameters_;
2581cb0ef41Sopenharmony_ci  CheckBoundsFlags flags_;
2591cb0ef41Sopenharmony_ci};
2601cb0ef41Sopenharmony_ci
2611cb0ef41Sopenharmony_cibool operator==(CheckBoundsParameters const&, CheckBoundsParameters const&);
2621cb0ef41Sopenharmony_ci
2631cb0ef41Sopenharmony_cisize_t hash_value(CheckBoundsParameters const&);
2641cb0ef41Sopenharmony_ci
2651cb0ef41Sopenharmony_cistd::ostream& operator<<(std::ostream&, CheckBoundsParameters const&);
2661cb0ef41Sopenharmony_ci
2671cb0ef41Sopenharmony_ciCheckBoundsParameters const& CheckBoundsParametersOf(Operator const*)
2681cb0ef41Sopenharmony_ci    V8_WARN_UNUSED_RESULT;
2691cb0ef41Sopenharmony_ci
2701cb0ef41Sopenharmony_ciclass CheckIfParameters final {
2711cb0ef41Sopenharmony_ci public:
2721cb0ef41Sopenharmony_ci  explicit CheckIfParameters(DeoptimizeReason reason,
2731cb0ef41Sopenharmony_ci                             const FeedbackSource& feedback)
2741cb0ef41Sopenharmony_ci      : reason_(reason), feedback_(feedback) {}
2751cb0ef41Sopenharmony_ci
2761cb0ef41Sopenharmony_ci  FeedbackSource const& feedback() const { return feedback_; }
2771cb0ef41Sopenharmony_ci  DeoptimizeReason reason() const { return reason_; }
2781cb0ef41Sopenharmony_ci
2791cb0ef41Sopenharmony_ci private:
2801cb0ef41Sopenharmony_ci  DeoptimizeReason reason_;
2811cb0ef41Sopenharmony_ci  FeedbackSource feedback_;
2821cb0ef41Sopenharmony_ci};
2831cb0ef41Sopenharmony_ci
2841cb0ef41Sopenharmony_cibool operator==(CheckIfParameters const&, CheckIfParameters const&);
2851cb0ef41Sopenharmony_ci
2861cb0ef41Sopenharmony_cisize_t hash_value(CheckIfParameters const&);
2871cb0ef41Sopenharmony_ci
2881cb0ef41Sopenharmony_cistd::ostream& operator<<(std::ostream&, CheckIfParameters const&);
2891cb0ef41Sopenharmony_ci
2901cb0ef41Sopenharmony_ciCheckIfParameters const& CheckIfParametersOf(Operator const*)
2911cb0ef41Sopenharmony_ci    V8_WARN_UNUSED_RESULT;
2921cb0ef41Sopenharmony_ci
2931cb0ef41Sopenharmony_cienum class CheckFloat64HoleMode : uint8_t {
2941cb0ef41Sopenharmony_ci  kNeverReturnHole,  // Never return the hole (deoptimize instead).
2951cb0ef41Sopenharmony_ci  kAllowReturnHole   // Allow to return the hole (signaling NaN).
2961cb0ef41Sopenharmony_ci};
2971cb0ef41Sopenharmony_ci
2981cb0ef41Sopenharmony_cisize_t hash_value(CheckFloat64HoleMode);
2991cb0ef41Sopenharmony_ci
3001cb0ef41Sopenharmony_cistd::ostream& operator<<(std::ostream&, CheckFloat64HoleMode);
3011cb0ef41Sopenharmony_ci
3021cb0ef41Sopenharmony_ciclass CheckFloat64HoleParameters {
3031cb0ef41Sopenharmony_ci public:
3041cb0ef41Sopenharmony_ci  CheckFloat64HoleParameters(CheckFloat64HoleMode mode,
3051cb0ef41Sopenharmony_ci                             FeedbackSource const& feedback)
3061cb0ef41Sopenharmony_ci      : mode_(mode), feedback_(feedback) {}
3071cb0ef41Sopenharmony_ci
3081cb0ef41Sopenharmony_ci  CheckFloat64HoleMode mode() const { return mode_; }
3091cb0ef41Sopenharmony_ci  FeedbackSource const& feedback() const { return feedback_; }
3101cb0ef41Sopenharmony_ci
3111cb0ef41Sopenharmony_ci private:
3121cb0ef41Sopenharmony_ci  CheckFloat64HoleMode mode_;
3131cb0ef41Sopenharmony_ci  FeedbackSource feedback_;
3141cb0ef41Sopenharmony_ci};
3151cb0ef41Sopenharmony_ci
3161cb0ef41Sopenharmony_ciCheckFloat64HoleParameters const& CheckFloat64HoleParametersOf(Operator const*)
3171cb0ef41Sopenharmony_ci    V8_WARN_UNUSED_RESULT;
3181cb0ef41Sopenharmony_ci
3191cb0ef41Sopenharmony_cistd::ostream& operator<<(std::ostream&, CheckFloat64HoleParameters const&);
3201cb0ef41Sopenharmony_ci
3211cb0ef41Sopenharmony_cisize_t hash_value(CheckFloat64HoleParameters const&);
3221cb0ef41Sopenharmony_ci
3231cb0ef41Sopenharmony_cibool operator==(CheckFloat64HoleParameters const&,
3241cb0ef41Sopenharmony_ci                CheckFloat64HoleParameters const&);
3251cb0ef41Sopenharmony_cibool operator!=(CheckFloat64HoleParameters const&,
3261cb0ef41Sopenharmony_ci                CheckFloat64HoleParameters const&);
3271cb0ef41Sopenharmony_ci
3281cb0ef41Sopenharmony_ci// Parameter for CheckClosure node.
3291cb0ef41Sopenharmony_ciHandle<FeedbackCell> FeedbackCellOf(const Operator* op);
3301cb0ef41Sopenharmony_ci
3311cb0ef41Sopenharmony_cienum class CheckTaggedInputMode : uint8_t {
3321cb0ef41Sopenharmony_ci  kNumber,
3331cb0ef41Sopenharmony_ci  kNumberOrBoolean,
3341cb0ef41Sopenharmony_ci  kNumberOrOddball,
3351cb0ef41Sopenharmony_ci};
3361cb0ef41Sopenharmony_ci
3371cb0ef41Sopenharmony_cisize_t hash_value(CheckTaggedInputMode);
3381cb0ef41Sopenharmony_ci
3391cb0ef41Sopenharmony_ciV8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, CheckTaggedInputMode);
3401cb0ef41Sopenharmony_ci
3411cb0ef41Sopenharmony_ciclass CheckTaggedInputParameters {
3421cb0ef41Sopenharmony_ci public:
3431cb0ef41Sopenharmony_ci  CheckTaggedInputParameters(CheckTaggedInputMode mode,
3441cb0ef41Sopenharmony_ci                             const FeedbackSource& feedback)
3451cb0ef41Sopenharmony_ci      : mode_(mode), feedback_(feedback) {}
3461cb0ef41Sopenharmony_ci
3471cb0ef41Sopenharmony_ci  CheckTaggedInputMode mode() const { return mode_; }
3481cb0ef41Sopenharmony_ci  const FeedbackSource& feedback() const { return feedback_; }
3491cb0ef41Sopenharmony_ci
3501cb0ef41Sopenharmony_ci private:
3511cb0ef41Sopenharmony_ci  CheckTaggedInputMode mode_;
3521cb0ef41Sopenharmony_ci  FeedbackSource feedback_;
3531cb0ef41Sopenharmony_ci};
3541cb0ef41Sopenharmony_ci
3551cb0ef41Sopenharmony_ciconst CheckTaggedInputParameters& CheckTaggedInputParametersOf(const Operator*)
3561cb0ef41Sopenharmony_ci    V8_WARN_UNUSED_RESULT;
3571cb0ef41Sopenharmony_ci
3581cb0ef41Sopenharmony_cistd::ostream& operator<<(std::ostream&,
3591cb0ef41Sopenharmony_ci                         const CheckTaggedInputParameters& params);
3601cb0ef41Sopenharmony_ci
3611cb0ef41Sopenharmony_cisize_t hash_value(const CheckTaggedInputParameters& params);
3621cb0ef41Sopenharmony_ci
3631cb0ef41Sopenharmony_cibool operator==(CheckTaggedInputParameters const&,
3641cb0ef41Sopenharmony_ci                CheckTaggedInputParameters const&);
3651cb0ef41Sopenharmony_ci
3661cb0ef41Sopenharmony_cienum class CheckForMinusZeroMode : uint8_t {
3671cb0ef41Sopenharmony_ci  kCheckForMinusZero,
3681cb0ef41Sopenharmony_ci  kDontCheckForMinusZero,
3691cb0ef41Sopenharmony_ci};
3701cb0ef41Sopenharmony_ci
3711cb0ef41Sopenharmony_cisize_t hash_value(CheckForMinusZeroMode);
3721cb0ef41Sopenharmony_ci
3731cb0ef41Sopenharmony_ciV8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&,
3741cb0ef41Sopenharmony_ci                                           CheckForMinusZeroMode);
3751cb0ef41Sopenharmony_ci
3761cb0ef41Sopenharmony_ciCheckForMinusZeroMode CheckMinusZeroModeOf(const Operator*)
3771cb0ef41Sopenharmony_ci    V8_WARN_UNUSED_RESULT;
3781cb0ef41Sopenharmony_ci
3791cb0ef41Sopenharmony_ciclass CheckMinusZeroParameters {
3801cb0ef41Sopenharmony_ci public:
3811cb0ef41Sopenharmony_ci  CheckMinusZeroParameters(CheckForMinusZeroMode mode,
3821cb0ef41Sopenharmony_ci                           const FeedbackSource& feedback)
3831cb0ef41Sopenharmony_ci      : mode_(mode), feedback_(feedback) {}
3841cb0ef41Sopenharmony_ci
3851cb0ef41Sopenharmony_ci  CheckForMinusZeroMode mode() const { return mode_; }
3861cb0ef41Sopenharmony_ci  const FeedbackSource& feedback() const { return feedback_; }
3871cb0ef41Sopenharmony_ci
3881cb0ef41Sopenharmony_ci private:
3891cb0ef41Sopenharmony_ci  CheckForMinusZeroMode mode_;
3901cb0ef41Sopenharmony_ci  FeedbackSource feedback_;
3911cb0ef41Sopenharmony_ci};
3921cb0ef41Sopenharmony_ci
3931cb0ef41Sopenharmony_ciV8_EXPORT_PRIVATE const CheckMinusZeroParameters& CheckMinusZeroParametersOf(
3941cb0ef41Sopenharmony_ci    const Operator* op) V8_WARN_UNUSED_RESULT;
3951cb0ef41Sopenharmony_ci
3961cb0ef41Sopenharmony_ciV8_EXPORT_PRIVATE std::ostream& operator<<(
3971cb0ef41Sopenharmony_ci    std::ostream&, const CheckMinusZeroParameters& params);
3981cb0ef41Sopenharmony_ci
3991cb0ef41Sopenharmony_cisize_t hash_value(const CheckMinusZeroParameters& params);
4001cb0ef41Sopenharmony_ci
4011cb0ef41Sopenharmony_cibool operator==(CheckMinusZeroParameters const&,
4021cb0ef41Sopenharmony_ci                CheckMinusZeroParameters const&);
4031cb0ef41Sopenharmony_ci
4041cb0ef41Sopenharmony_cienum class CheckMapsFlag : uint8_t {
4051cb0ef41Sopenharmony_ci  kNone = 0u,
4061cb0ef41Sopenharmony_ci  kTryMigrateInstance = 1u << 0,
4071cb0ef41Sopenharmony_ci};
4081cb0ef41Sopenharmony_ciusing CheckMapsFlags = base::Flags<CheckMapsFlag>;
4091cb0ef41Sopenharmony_ci
4101cb0ef41Sopenharmony_ciDEFINE_OPERATORS_FOR_FLAGS(CheckMapsFlags)
4111cb0ef41Sopenharmony_ci
4121cb0ef41Sopenharmony_cistd::ostream& operator<<(std::ostream&, CheckMapsFlags);
4131cb0ef41Sopenharmony_ci
4141cb0ef41Sopenharmony_ci// A descriptor for map checks. The {feedback} parameter is optional.
4151cb0ef41Sopenharmony_ci// If {feedback} references a valid CallIC slot and this MapCheck fails,
4161cb0ef41Sopenharmony_ci// then speculation on that CallIC slot will be disabled.
4171cb0ef41Sopenharmony_ciclass CheckMapsParameters final {
4181cb0ef41Sopenharmony_ci public:
4191cb0ef41Sopenharmony_ci  CheckMapsParameters(CheckMapsFlags flags, ZoneHandleSet<Map> const& maps,
4201cb0ef41Sopenharmony_ci                      const FeedbackSource& feedback)
4211cb0ef41Sopenharmony_ci      : flags_(flags), maps_(maps), feedback_(feedback) {}
4221cb0ef41Sopenharmony_ci
4231cb0ef41Sopenharmony_ci  CheckMapsFlags flags() const { return flags_; }
4241cb0ef41Sopenharmony_ci  ZoneHandleSet<Map> const& maps() const { return maps_; }
4251cb0ef41Sopenharmony_ci  FeedbackSource const& feedback() const { return feedback_; }
4261cb0ef41Sopenharmony_ci
4271cb0ef41Sopenharmony_ci private:
4281cb0ef41Sopenharmony_ci  CheckMapsFlags const flags_;
4291cb0ef41Sopenharmony_ci  ZoneHandleSet<Map> const maps_;
4301cb0ef41Sopenharmony_ci  FeedbackSource const feedback_;
4311cb0ef41Sopenharmony_ci};
4321cb0ef41Sopenharmony_ci
4331cb0ef41Sopenharmony_cibool operator==(CheckMapsParameters const&, CheckMapsParameters const&);
4341cb0ef41Sopenharmony_ci
4351cb0ef41Sopenharmony_cisize_t hash_value(CheckMapsParameters const&);
4361cb0ef41Sopenharmony_ci
4371cb0ef41Sopenharmony_cistd::ostream& operator<<(std::ostream&, CheckMapsParameters const&);
4381cb0ef41Sopenharmony_ci
4391cb0ef41Sopenharmony_ciCheckMapsParameters const& CheckMapsParametersOf(Operator const*)
4401cb0ef41Sopenharmony_ci    V8_WARN_UNUSED_RESULT;
4411cb0ef41Sopenharmony_ci
4421cb0ef41Sopenharmony_ciZoneHandleSet<Map> const& MapGuardMapsOf(Operator const*) V8_WARN_UNUSED_RESULT;
4431cb0ef41Sopenharmony_ci
4441cb0ef41Sopenharmony_ci// Parameters for CompareMaps operator.
4451cb0ef41Sopenharmony_ciZoneHandleSet<Map> const& CompareMapsParametersOf(Operator const*)
4461cb0ef41Sopenharmony_ci    V8_WARN_UNUSED_RESULT;
4471cb0ef41Sopenharmony_ci
4481cb0ef41Sopenharmony_ci// A descriptor for growing elements backing stores.
4491cb0ef41Sopenharmony_cienum class GrowFastElementsMode : uint8_t {
4501cb0ef41Sopenharmony_ci  kDoubleElements,
4511cb0ef41Sopenharmony_ci  kSmiOrObjectElements
4521cb0ef41Sopenharmony_ci};
4531cb0ef41Sopenharmony_ci
4541cb0ef41Sopenharmony_ciinline size_t hash_value(GrowFastElementsMode mode) {
4551cb0ef41Sopenharmony_ci  return static_cast<uint8_t>(mode);
4561cb0ef41Sopenharmony_ci}
4571cb0ef41Sopenharmony_ci
4581cb0ef41Sopenharmony_cistd::ostream& operator<<(std::ostream&, GrowFastElementsMode);
4591cb0ef41Sopenharmony_ci
4601cb0ef41Sopenharmony_ciclass GrowFastElementsParameters {
4611cb0ef41Sopenharmony_ci public:
4621cb0ef41Sopenharmony_ci  GrowFastElementsParameters(GrowFastElementsMode mode,
4631cb0ef41Sopenharmony_ci                             const FeedbackSource& feedback)
4641cb0ef41Sopenharmony_ci      : mode_(mode), feedback_(feedback) {}
4651cb0ef41Sopenharmony_ci
4661cb0ef41Sopenharmony_ci  GrowFastElementsMode mode() const { return mode_; }
4671cb0ef41Sopenharmony_ci  const FeedbackSource& feedback() const { return feedback_; }
4681cb0ef41Sopenharmony_ci
4691cb0ef41Sopenharmony_ci private:
4701cb0ef41Sopenharmony_ci  GrowFastElementsMode mode_;
4711cb0ef41Sopenharmony_ci  FeedbackSource feedback_;
4721cb0ef41Sopenharmony_ci};
4731cb0ef41Sopenharmony_ci
4741cb0ef41Sopenharmony_cibool operator==(const GrowFastElementsParameters&,
4751cb0ef41Sopenharmony_ci                const GrowFastElementsParameters&);
4761cb0ef41Sopenharmony_ci
4771cb0ef41Sopenharmony_ciinline size_t hash_value(const GrowFastElementsParameters&);
4781cb0ef41Sopenharmony_ci
4791cb0ef41Sopenharmony_cistd::ostream& operator<<(std::ostream&, const GrowFastElementsParameters&);
4801cb0ef41Sopenharmony_ci
4811cb0ef41Sopenharmony_ciconst GrowFastElementsParameters& GrowFastElementsParametersOf(const Operator*)
4821cb0ef41Sopenharmony_ci    V8_WARN_UNUSED_RESULT;
4831cb0ef41Sopenharmony_ci
4841cb0ef41Sopenharmony_ci// A descriptor for elements kind transitions.
4851cb0ef41Sopenharmony_ciclass ElementsTransition final {
4861cb0ef41Sopenharmony_ci public:
4871cb0ef41Sopenharmony_ci  enum Mode : uint8_t {
4881cb0ef41Sopenharmony_ci    kFastTransition,  // simple transition, just updating the map.
4891cb0ef41Sopenharmony_ci    kSlowTransition   // full transition, round-trip to the runtime.
4901cb0ef41Sopenharmony_ci  };
4911cb0ef41Sopenharmony_ci
4921cb0ef41Sopenharmony_ci  ElementsTransition(Mode mode, Handle<Map> source, Handle<Map> target)
4931cb0ef41Sopenharmony_ci      : mode_(mode), source_(source), target_(target) {}
4941cb0ef41Sopenharmony_ci
4951cb0ef41Sopenharmony_ci  Mode mode() const { return mode_; }
4961cb0ef41Sopenharmony_ci  Handle<Map> source() const { return source_; }
4971cb0ef41Sopenharmony_ci  Handle<Map> target() const { return target_; }
4981cb0ef41Sopenharmony_ci
4991cb0ef41Sopenharmony_ci private:
5001cb0ef41Sopenharmony_ci  Mode const mode_;
5011cb0ef41Sopenharmony_ci  Handle<Map> const source_;
5021cb0ef41Sopenharmony_ci  Handle<Map> const target_;
5031cb0ef41Sopenharmony_ci};
5041cb0ef41Sopenharmony_ci
5051cb0ef41Sopenharmony_cibool operator==(ElementsTransition const&, ElementsTransition const&);
5061cb0ef41Sopenharmony_ci
5071cb0ef41Sopenharmony_cisize_t hash_value(ElementsTransition);
5081cb0ef41Sopenharmony_ci
5091cb0ef41Sopenharmony_cistd::ostream& operator<<(std::ostream&, ElementsTransition);
5101cb0ef41Sopenharmony_ci
5111cb0ef41Sopenharmony_ciElementsTransition const& ElementsTransitionOf(const Operator* op)
5121cb0ef41Sopenharmony_ci    V8_WARN_UNUSED_RESULT;
5131cb0ef41Sopenharmony_ci
5141cb0ef41Sopenharmony_ci// Parameters for TransitionAndStoreElement, or
5151cb0ef41Sopenharmony_ci// TransitionAndStoreNonNumberElement, or
5161cb0ef41Sopenharmony_ci// TransitionAndStoreNumberElement.
5171cb0ef41Sopenharmony_ciHandle<Map> DoubleMapParameterOf(const Operator* op) V8_WARN_UNUSED_RESULT;
5181cb0ef41Sopenharmony_ciHandle<Map> FastMapParameterOf(const Operator* op) V8_WARN_UNUSED_RESULT;
5191cb0ef41Sopenharmony_ci
5201cb0ef41Sopenharmony_ci// Parameters for TransitionAndStoreNonNumberElement.
5211cb0ef41Sopenharmony_ciType ValueTypeParameterOf(const Operator* op) V8_WARN_UNUSED_RESULT;
5221cb0ef41Sopenharmony_ci
5231cb0ef41Sopenharmony_ci// A hint for speculative number operations.
5241cb0ef41Sopenharmony_cienum class NumberOperationHint : uint8_t {
5251cb0ef41Sopenharmony_ci  kSignedSmall,        // Inputs were Smi, output was in Smi.
5261cb0ef41Sopenharmony_ci  kSignedSmallInputs,  // Inputs were Smi, output was Number.
5271cb0ef41Sopenharmony_ci  kNumber,             // Inputs were Number, output was Number.
5281cb0ef41Sopenharmony_ci  kNumberOrBoolean,    // Inputs were Number or Boolean, output was Number.
5291cb0ef41Sopenharmony_ci  kNumberOrOddball,    // Inputs were Number or Oddball, output was Number.
5301cb0ef41Sopenharmony_ci};
5311cb0ef41Sopenharmony_ci
5321cb0ef41Sopenharmony_cienum class BigIntOperationHint : uint8_t {
5331cb0ef41Sopenharmony_ci  kBigInt,
5341cb0ef41Sopenharmony_ci};
5351cb0ef41Sopenharmony_ci
5361cb0ef41Sopenharmony_cisize_t hash_value(NumberOperationHint);
5371cb0ef41Sopenharmony_cisize_t hash_value(BigIntOperationHint);
5381cb0ef41Sopenharmony_ci
5391cb0ef41Sopenharmony_ciV8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, NumberOperationHint);
5401cb0ef41Sopenharmony_ciV8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, BigIntOperationHint);
5411cb0ef41Sopenharmony_ciV8_EXPORT_PRIVATE NumberOperationHint NumberOperationHintOf(const Operator* op)
5421cb0ef41Sopenharmony_ci    V8_WARN_UNUSED_RESULT;
5431cb0ef41Sopenharmony_ci
5441cb0ef41Sopenharmony_ciclass NumberOperationParameters {
5451cb0ef41Sopenharmony_ci public:
5461cb0ef41Sopenharmony_ci  NumberOperationParameters(NumberOperationHint hint,
5471cb0ef41Sopenharmony_ci                            const FeedbackSource& feedback)
5481cb0ef41Sopenharmony_ci      : hint_(hint), feedback_(feedback) {}
5491cb0ef41Sopenharmony_ci
5501cb0ef41Sopenharmony_ci  NumberOperationHint hint() const { return hint_; }
5511cb0ef41Sopenharmony_ci  const FeedbackSource& feedback() const { return feedback_; }
5521cb0ef41Sopenharmony_ci
5531cb0ef41Sopenharmony_ci private:
5541cb0ef41Sopenharmony_ci  NumberOperationHint hint_;
5551cb0ef41Sopenharmony_ci  FeedbackSource feedback_;
5561cb0ef41Sopenharmony_ci};
5571cb0ef41Sopenharmony_ci
5581cb0ef41Sopenharmony_cisize_t hash_value(NumberOperationParameters const&);
5591cb0ef41Sopenharmony_ciV8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&,
5601cb0ef41Sopenharmony_ci                                           const NumberOperationParameters&);
5611cb0ef41Sopenharmony_cibool operator==(NumberOperationParameters const&,
5621cb0ef41Sopenharmony_ci                NumberOperationParameters const&);
5631cb0ef41Sopenharmony_ciconst NumberOperationParameters& NumberOperationParametersOf(const Operator* op)
5641cb0ef41Sopenharmony_ci    V8_WARN_UNUSED_RESULT;
5651cb0ef41Sopenharmony_ci
5661cb0ef41Sopenharmony_ciclass SpeculativeBigIntAsNParameters {
5671cb0ef41Sopenharmony_ci public:
5681cb0ef41Sopenharmony_ci  SpeculativeBigIntAsNParameters(int bits, const FeedbackSource& feedback)
5691cb0ef41Sopenharmony_ci      : bits_(bits), feedback_(feedback) {
5701cb0ef41Sopenharmony_ci    DCHECK_GE(bits_, 0);
5711cb0ef41Sopenharmony_ci    DCHECK_LE(bits_, 64);
5721cb0ef41Sopenharmony_ci  }
5731cb0ef41Sopenharmony_ci
5741cb0ef41Sopenharmony_ci  int bits() const { return bits_; }
5751cb0ef41Sopenharmony_ci  const FeedbackSource& feedback() const { return feedback_; }
5761cb0ef41Sopenharmony_ci
5771cb0ef41Sopenharmony_ci private:
5781cb0ef41Sopenharmony_ci  int bits_;
5791cb0ef41Sopenharmony_ci  FeedbackSource feedback_;
5801cb0ef41Sopenharmony_ci};
5811cb0ef41Sopenharmony_ci
5821cb0ef41Sopenharmony_cisize_t hash_value(SpeculativeBigIntAsNParameters const&);
5831cb0ef41Sopenharmony_ciV8_EXPORT_PRIVATE std::ostream& operator<<(
5841cb0ef41Sopenharmony_ci    std::ostream&, const SpeculativeBigIntAsNParameters&);
5851cb0ef41Sopenharmony_cibool operator==(SpeculativeBigIntAsNParameters const&,
5861cb0ef41Sopenharmony_ci                SpeculativeBigIntAsNParameters const&);
5871cb0ef41Sopenharmony_ciconst SpeculativeBigIntAsNParameters& SpeculativeBigIntAsNParametersOf(
5881cb0ef41Sopenharmony_ci    const Operator* op) V8_WARN_UNUSED_RESULT;
5891cb0ef41Sopenharmony_ci
5901cb0ef41Sopenharmony_ciint FormalParameterCountOf(const Operator* op) V8_WARN_UNUSED_RESULT;
5911cb0ef41Sopenharmony_ci
5921cb0ef41Sopenharmony_ciclass AllocateParameters {
5931cb0ef41Sopenharmony_ci public:
5941cb0ef41Sopenharmony_ci  AllocateParameters(
5951cb0ef41Sopenharmony_ci      Type type, AllocationType allocation_type,
5961cb0ef41Sopenharmony_ci      AllowLargeObjects allow_large_objects = AllowLargeObjects::kFalse)
5971cb0ef41Sopenharmony_ci      : type_(type),
5981cb0ef41Sopenharmony_ci        allocation_type_(allocation_type),
5991cb0ef41Sopenharmony_ci        allow_large_objects_(allow_large_objects) {}
6001cb0ef41Sopenharmony_ci
6011cb0ef41Sopenharmony_ci  Type type() const { return type_; }
6021cb0ef41Sopenharmony_ci  AllocationType allocation_type() const { return allocation_type_; }
6031cb0ef41Sopenharmony_ci  AllowLargeObjects allow_large_objects() const { return allow_large_objects_; }
6041cb0ef41Sopenharmony_ci
6051cb0ef41Sopenharmony_ci private:
6061cb0ef41Sopenharmony_ci  Type type_;
6071cb0ef41Sopenharmony_ci  AllocationType allocation_type_;
6081cb0ef41Sopenharmony_ci  AllowLargeObjects allow_large_objects_;
6091cb0ef41Sopenharmony_ci};
6101cb0ef41Sopenharmony_ci
6111cb0ef41Sopenharmony_cibool IsCheckedWithFeedback(const Operator* op);
6121cb0ef41Sopenharmony_ci
6131cb0ef41Sopenharmony_cisize_t hash_value(AllocateParameters);
6141cb0ef41Sopenharmony_ci
6151cb0ef41Sopenharmony_ciV8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, AllocateParameters);
6161cb0ef41Sopenharmony_ci
6171cb0ef41Sopenharmony_cibool operator==(AllocateParameters const&, AllocateParameters const&);
6181cb0ef41Sopenharmony_ci
6191cb0ef41Sopenharmony_ciconst AllocateParameters& AllocateParametersOf(const Operator* op)
6201cb0ef41Sopenharmony_ci    V8_WARN_UNUSED_RESULT;
6211cb0ef41Sopenharmony_ci
6221cb0ef41Sopenharmony_ciAllocationType AllocationTypeOf(const Operator* op) V8_WARN_UNUSED_RESULT;
6231cb0ef41Sopenharmony_ci
6241cb0ef41Sopenharmony_ciType AllocateTypeOf(const Operator* op) V8_WARN_UNUSED_RESULT;
6251cb0ef41Sopenharmony_ci
6261cb0ef41Sopenharmony_ciUnicodeEncoding UnicodeEncodingOf(const Operator*) V8_WARN_UNUSED_RESULT;
6271cb0ef41Sopenharmony_ci
6281cb0ef41Sopenharmony_ciAbortReason AbortReasonOf(const Operator* op) V8_WARN_UNUSED_RESULT;
6291cb0ef41Sopenharmony_ci
6301cb0ef41Sopenharmony_ciDeoptimizeReason DeoptimizeReasonOf(const Operator* op) V8_WARN_UNUSED_RESULT;
6311cb0ef41Sopenharmony_ci
6321cb0ef41Sopenharmony_ciclass NewArgumentsElementsParameters {
6331cb0ef41Sopenharmony_ci public:
6341cb0ef41Sopenharmony_ci  NewArgumentsElementsParameters(CreateArgumentsType type,
6351cb0ef41Sopenharmony_ci                                 int formal_parameter_count)
6361cb0ef41Sopenharmony_ci      : type_(type), formal_parameter_count_(formal_parameter_count) {}
6371cb0ef41Sopenharmony_ci
6381cb0ef41Sopenharmony_ci  CreateArgumentsType arguments_type() const { return type_; }
6391cb0ef41Sopenharmony_ci  int formal_parameter_count() const { return formal_parameter_count_; }
6401cb0ef41Sopenharmony_ci
6411cb0ef41Sopenharmony_ci private:
6421cb0ef41Sopenharmony_ci  CreateArgumentsType type_;
6431cb0ef41Sopenharmony_ci  int formal_parameter_count_;
6441cb0ef41Sopenharmony_ci};
6451cb0ef41Sopenharmony_ci
6461cb0ef41Sopenharmony_cibool operator==(const NewArgumentsElementsParameters&,
6471cb0ef41Sopenharmony_ci                const NewArgumentsElementsParameters&);
6481cb0ef41Sopenharmony_ci
6491cb0ef41Sopenharmony_ciinline size_t hash_value(const NewArgumentsElementsParameters&);
6501cb0ef41Sopenharmony_ci
6511cb0ef41Sopenharmony_cistd::ostream& operator<<(std::ostream&, const NewArgumentsElementsParameters&);
6521cb0ef41Sopenharmony_ci
6531cb0ef41Sopenharmony_ciconst NewArgumentsElementsParameters& NewArgumentsElementsParametersOf(
6541cb0ef41Sopenharmony_ci    const Operator*) V8_WARN_UNUSED_RESULT;
6551cb0ef41Sopenharmony_ci
6561cb0ef41Sopenharmony_cistruct FastApiCallFunction {
6571cb0ef41Sopenharmony_ci  Address address;
6581cb0ef41Sopenharmony_ci  const CFunctionInfo* signature;
6591cb0ef41Sopenharmony_ci
6601cb0ef41Sopenharmony_ci  bool operator==(const FastApiCallFunction& rhs) const {
6611cb0ef41Sopenharmony_ci    return address == rhs.address && signature == rhs.signature;
6621cb0ef41Sopenharmony_ci  }
6631cb0ef41Sopenharmony_ci};
6641cb0ef41Sopenharmony_citypedef ZoneVector<FastApiCallFunction> FastApiCallFunctionVector;
6651cb0ef41Sopenharmony_ci
6661cb0ef41Sopenharmony_ciclass FastApiCallParameters {
6671cb0ef41Sopenharmony_ci public:
6681cb0ef41Sopenharmony_ci  explicit FastApiCallParameters(const FastApiCallFunctionVector& c_functions,
6691cb0ef41Sopenharmony_ci                                 FeedbackSource const& feedback,
6701cb0ef41Sopenharmony_ci                                 CallDescriptor* descriptor)
6711cb0ef41Sopenharmony_ci      : c_functions_(c_functions),
6721cb0ef41Sopenharmony_ci        feedback_(feedback),
6731cb0ef41Sopenharmony_ci        descriptor_(descriptor) {}
6741cb0ef41Sopenharmony_ci
6751cb0ef41Sopenharmony_ci  const FastApiCallFunctionVector& c_functions() const { return c_functions_; }
6761cb0ef41Sopenharmony_ci  FeedbackSource const& feedback() const { return feedback_; }
6771cb0ef41Sopenharmony_ci  CallDescriptor* descriptor() const { return descriptor_; }
6781cb0ef41Sopenharmony_ci
6791cb0ef41Sopenharmony_ci private:
6801cb0ef41Sopenharmony_ci  // A single FastApiCall node can represent multiple overloaded functions.
6811cb0ef41Sopenharmony_ci  const FastApiCallFunctionVector c_functions_;
6821cb0ef41Sopenharmony_ci
6831cb0ef41Sopenharmony_ci  const FeedbackSource feedback_;
6841cb0ef41Sopenharmony_ci  CallDescriptor* descriptor_;
6851cb0ef41Sopenharmony_ci};
6861cb0ef41Sopenharmony_ci
6871cb0ef41Sopenharmony_ciFastApiCallParameters const& FastApiCallParametersOf(const Operator* op)
6881cb0ef41Sopenharmony_ci    V8_WARN_UNUSED_RESULT;
6891cb0ef41Sopenharmony_ci
6901cb0ef41Sopenharmony_ciV8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&,
6911cb0ef41Sopenharmony_ci                                           FastApiCallParameters const&);
6921cb0ef41Sopenharmony_ci
6931cb0ef41Sopenharmony_cisize_t hash_value(FastApiCallParameters const&);
6941cb0ef41Sopenharmony_ci
6951cb0ef41Sopenharmony_cibool operator==(FastApiCallParameters const&, FastApiCallParameters const&);
6961cb0ef41Sopenharmony_ci
6971cb0ef41Sopenharmony_ci// Interface for building simplified operators, which represent the
6981cb0ef41Sopenharmony_ci// medium-level operations of V8, including adding numbers, allocating objects,
6991cb0ef41Sopenharmony_ci// indexing into objects and arrays, etc.
7001cb0ef41Sopenharmony_ci// All operators are typed but many are representation independent.
7011cb0ef41Sopenharmony_ci
7021cb0ef41Sopenharmony_ci// Number values from JS can be in one of these representations:
7031cb0ef41Sopenharmony_ci//   - Tagged: word-sized integer that is either
7041cb0ef41Sopenharmony_ci//     - a signed small integer (31 or 32 bits plus a tag)
7051cb0ef41Sopenharmony_ci//     - a tagged pointer to a HeapNumber object that has a float64 field
7061cb0ef41Sopenharmony_ci//   - Int32: an untagged signed 32-bit integer
7071cb0ef41Sopenharmony_ci//   - Uint32: an untagged unsigned 32-bit integer
7081cb0ef41Sopenharmony_ci//   - Float64: an untagged float64
7091cb0ef41Sopenharmony_ci
7101cb0ef41Sopenharmony_ci// Additional representations for intermediate code or non-JS code:
7111cb0ef41Sopenharmony_ci//   - Int64: an untagged signed 64-bit integer
7121cb0ef41Sopenharmony_ci//   - Uint64: an untagged unsigned 64-bit integer
7131cb0ef41Sopenharmony_ci//   - Float32: an untagged float32
7141cb0ef41Sopenharmony_ci
7151cb0ef41Sopenharmony_ci// Boolean values can be:
7161cb0ef41Sopenharmony_ci//   - Bool: a tagged pointer to either the canonical JS #false or
7171cb0ef41Sopenharmony_ci//           the canonical JS #true object
7181cb0ef41Sopenharmony_ci//   - Bit: an untagged integer 0 or 1, but word-sized
7191cb0ef41Sopenharmony_ciclass V8_EXPORT_PRIVATE SimplifiedOperatorBuilder final
7201cb0ef41Sopenharmony_ci    : public NON_EXPORTED_BASE(ZoneObject) {
7211cb0ef41Sopenharmony_ci public:
7221cb0ef41Sopenharmony_ci  explicit SimplifiedOperatorBuilder(Zone* zone);
7231cb0ef41Sopenharmony_ci  SimplifiedOperatorBuilder(const SimplifiedOperatorBuilder&) = delete;
7241cb0ef41Sopenharmony_ci  SimplifiedOperatorBuilder& operator=(const SimplifiedOperatorBuilder&) =
7251cb0ef41Sopenharmony_ci      delete;
7261cb0ef41Sopenharmony_ci
7271cb0ef41Sopenharmony_ci  const Operator* BooleanNot();
7281cb0ef41Sopenharmony_ci
7291cb0ef41Sopenharmony_ci  const Operator* NumberEqual();
7301cb0ef41Sopenharmony_ci  const Operator* NumberSameValue();
7311cb0ef41Sopenharmony_ci  const Operator* NumberLessThan();
7321cb0ef41Sopenharmony_ci  const Operator* NumberLessThanOrEqual();
7331cb0ef41Sopenharmony_ci  const Operator* NumberAdd();
7341cb0ef41Sopenharmony_ci  const Operator* NumberSubtract();
7351cb0ef41Sopenharmony_ci  const Operator* NumberMultiply();
7361cb0ef41Sopenharmony_ci  const Operator* NumberDivide();
7371cb0ef41Sopenharmony_ci  const Operator* NumberModulus();
7381cb0ef41Sopenharmony_ci  const Operator* NumberBitwiseOr();
7391cb0ef41Sopenharmony_ci  const Operator* NumberBitwiseXor();
7401cb0ef41Sopenharmony_ci  const Operator* NumberBitwiseAnd();
7411cb0ef41Sopenharmony_ci  const Operator* NumberShiftLeft();
7421cb0ef41Sopenharmony_ci  const Operator* NumberShiftRight();
7431cb0ef41Sopenharmony_ci  const Operator* NumberShiftRightLogical();
7441cb0ef41Sopenharmony_ci  const Operator* NumberImul();
7451cb0ef41Sopenharmony_ci  const Operator* NumberAbs();
7461cb0ef41Sopenharmony_ci  const Operator* NumberClz32();
7471cb0ef41Sopenharmony_ci  const Operator* NumberCeil();
7481cb0ef41Sopenharmony_ci  const Operator* NumberFloor();
7491cb0ef41Sopenharmony_ci  const Operator* NumberFround();
7501cb0ef41Sopenharmony_ci  const Operator* NumberAcos();
7511cb0ef41Sopenharmony_ci  const Operator* NumberAcosh();
7521cb0ef41Sopenharmony_ci  const Operator* NumberAsin();
7531cb0ef41Sopenharmony_ci  const Operator* NumberAsinh();
7541cb0ef41Sopenharmony_ci  const Operator* NumberAtan();
7551cb0ef41Sopenharmony_ci  const Operator* NumberAtan2();
7561cb0ef41Sopenharmony_ci  const Operator* NumberAtanh();
7571cb0ef41Sopenharmony_ci  const Operator* NumberCbrt();
7581cb0ef41Sopenharmony_ci  const Operator* NumberCos();
7591cb0ef41Sopenharmony_ci  const Operator* NumberCosh();
7601cb0ef41Sopenharmony_ci  const Operator* NumberExp();
7611cb0ef41Sopenharmony_ci  const Operator* NumberExpm1();
7621cb0ef41Sopenharmony_ci  const Operator* NumberLog();
7631cb0ef41Sopenharmony_ci  const Operator* NumberLog1p();
7641cb0ef41Sopenharmony_ci  const Operator* NumberLog10();
7651cb0ef41Sopenharmony_ci  const Operator* NumberLog2();
7661cb0ef41Sopenharmony_ci  const Operator* NumberMax();
7671cb0ef41Sopenharmony_ci  const Operator* NumberMin();
7681cb0ef41Sopenharmony_ci  const Operator* NumberPow();
7691cb0ef41Sopenharmony_ci  const Operator* NumberRound();
7701cb0ef41Sopenharmony_ci  const Operator* NumberSign();
7711cb0ef41Sopenharmony_ci  const Operator* NumberSin();
7721cb0ef41Sopenharmony_ci  const Operator* NumberSinh();
7731cb0ef41Sopenharmony_ci  const Operator* NumberSqrt();
7741cb0ef41Sopenharmony_ci  const Operator* NumberTan();
7751cb0ef41Sopenharmony_ci  const Operator* NumberTanh();
7761cb0ef41Sopenharmony_ci  const Operator* NumberTrunc();
7771cb0ef41Sopenharmony_ci  const Operator* NumberToBoolean();
7781cb0ef41Sopenharmony_ci  const Operator* NumberToInt32();
7791cb0ef41Sopenharmony_ci  const Operator* NumberToString();
7801cb0ef41Sopenharmony_ci  const Operator* NumberToUint32();
7811cb0ef41Sopenharmony_ci  const Operator* NumberToUint8Clamped();
7821cb0ef41Sopenharmony_ci
7831cb0ef41Sopenharmony_ci  const Operator* NumberSilenceNaN();
7841cb0ef41Sopenharmony_ci
7851cb0ef41Sopenharmony_ci  const Operator* BigIntAdd();
7861cb0ef41Sopenharmony_ci  const Operator* BigIntSubtract();
7871cb0ef41Sopenharmony_ci  const Operator* BigIntNegate();
7881cb0ef41Sopenharmony_ci
7891cb0ef41Sopenharmony_ci  const Operator* SpeculativeSafeIntegerAdd(NumberOperationHint hint);
7901cb0ef41Sopenharmony_ci  const Operator* SpeculativeSafeIntegerSubtract(NumberOperationHint hint);
7911cb0ef41Sopenharmony_ci
7921cb0ef41Sopenharmony_ci  const Operator* SpeculativeNumberAdd(NumberOperationHint hint);
7931cb0ef41Sopenharmony_ci  const Operator* SpeculativeNumberSubtract(NumberOperationHint hint);
7941cb0ef41Sopenharmony_ci  const Operator* SpeculativeNumberMultiply(NumberOperationHint hint);
7951cb0ef41Sopenharmony_ci  const Operator* SpeculativeNumberDivide(NumberOperationHint hint);
7961cb0ef41Sopenharmony_ci  const Operator* SpeculativeNumberModulus(NumberOperationHint hint);
7971cb0ef41Sopenharmony_ci  const Operator* SpeculativeNumberShiftLeft(NumberOperationHint hint);
7981cb0ef41Sopenharmony_ci  const Operator* SpeculativeNumberShiftRight(NumberOperationHint hint);
7991cb0ef41Sopenharmony_ci  const Operator* SpeculativeNumberShiftRightLogical(NumberOperationHint hint);
8001cb0ef41Sopenharmony_ci  const Operator* SpeculativeNumberBitwiseAnd(NumberOperationHint hint);
8011cb0ef41Sopenharmony_ci  const Operator* SpeculativeNumberBitwiseOr(NumberOperationHint hint);
8021cb0ef41Sopenharmony_ci  const Operator* SpeculativeNumberBitwiseXor(NumberOperationHint hint);
8031cb0ef41Sopenharmony_ci  const Operator* SpeculativeNumberPow(NumberOperationHint hint);
8041cb0ef41Sopenharmony_ci
8051cb0ef41Sopenharmony_ci  const Operator* SpeculativeNumberLessThan(NumberOperationHint hint);
8061cb0ef41Sopenharmony_ci  const Operator* SpeculativeNumberLessThanOrEqual(NumberOperationHint hint);
8071cb0ef41Sopenharmony_ci  const Operator* SpeculativeNumberEqual(NumberOperationHint hint);
8081cb0ef41Sopenharmony_ci
8091cb0ef41Sopenharmony_ci  const Operator* SpeculativeBigIntAdd(BigIntOperationHint hint);
8101cb0ef41Sopenharmony_ci  const Operator* SpeculativeBigIntSubtract(BigIntOperationHint hint);
8111cb0ef41Sopenharmony_ci  const Operator* SpeculativeBigIntNegate(BigIntOperationHint hint);
8121cb0ef41Sopenharmony_ci  const Operator* SpeculativeBigIntAsIntN(int bits,
8131cb0ef41Sopenharmony_ci                                          const FeedbackSource& feedback);
8141cb0ef41Sopenharmony_ci  const Operator* SpeculativeBigIntAsUintN(int bits,
8151cb0ef41Sopenharmony_ci                                           const FeedbackSource& feedback);
8161cb0ef41Sopenharmony_ci
8171cb0ef41Sopenharmony_ci  const Operator* ReferenceEqual();
8181cb0ef41Sopenharmony_ci  const Operator* SameValue();
8191cb0ef41Sopenharmony_ci  const Operator* SameValueNumbersOnly();
8201cb0ef41Sopenharmony_ci
8211cb0ef41Sopenharmony_ci  const Operator* TypeOf();
8221cb0ef41Sopenharmony_ci
8231cb0ef41Sopenharmony_ci  const Operator* ToBoolean();
8241cb0ef41Sopenharmony_ci
8251cb0ef41Sopenharmony_ci  const Operator* StringConcat();
8261cb0ef41Sopenharmony_ci  const Operator* StringEqual();
8271cb0ef41Sopenharmony_ci  const Operator* StringLessThan();
8281cb0ef41Sopenharmony_ci  const Operator* StringLessThanOrEqual();
8291cb0ef41Sopenharmony_ci  const Operator* StringCharCodeAt();
8301cb0ef41Sopenharmony_ci  const Operator* StringCodePointAt();
8311cb0ef41Sopenharmony_ci  const Operator* StringFromSingleCharCode();
8321cb0ef41Sopenharmony_ci  const Operator* StringFromSingleCodePoint();
8331cb0ef41Sopenharmony_ci  const Operator* StringFromCodePointAt();
8341cb0ef41Sopenharmony_ci  const Operator* StringIndexOf();
8351cb0ef41Sopenharmony_ci  const Operator* StringLength();
8361cb0ef41Sopenharmony_ci  const Operator* StringToLowerCaseIntl();
8371cb0ef41Sopenharmony_ci  const Operator* StringToUpperCaseIntl();
8381cb0ef41Sopenharmony_ci  const Operator* StringSubstring();
8391cb0ef41Sopenharmony_ci
8401cb0ef41Sopenharmony_ci  const Operator* FindOrderedHashMapEntry();
8411cb0ef41Sopenharmony_ci  const Operator* FindOrderedHashMapEntryForInt32Key();
8421cb0ef41Sopenharmony_ci
8431cb0ef41Sopenharmony_ci  const Operator* SpeculativeToNumber(NumberOperationHint hint,
8441cb0ef41Sopenharmony_ci                                      const FeedbackSource& feedback);
8451cb0ef41Sopenharmony_ci
8461cb0ef41Sopenharmony_ci  const Operator* StringToNumber();
8471cb0ef41Sopenharmony_ci  const Operator* PlainPrimitiveToNumber();
8481cb0ef41Sopenharmony_ci  const Operator* PlainPrimitiveToWord32();
8491cb0ef41Sopenharmony_ci  const Operator* PlainPrimitiveToFloat64();
8501cb0ef41Sopenharmony_ci
8511cb0ef41Sopenharmony_ci  const Operator* ChangeTaggedSignedToInt32();
8521cb0ef41Sopenharmony_ci  const Operator* ChangeTaggedSignedToInt64();
8531cb0ef41Sopenharmony_ci  const Operator* ChangeTaggedToInt32();
8541cb0ef41Sopenharmony_ci  const Operator* ChangeTaggedToInt64();
8551cb0ef41Sopenharmony_ci  const Operator* ChangeTaggedToUint32();
8561cb0ef41Sopenharmony_ci  const Operator* ChangeTaggedToFloat64();
8571cb0ef41Sopenharmony_ci  const Operator* ChangeTaggedToTaggedSigned();
8581cb0ef41Sopenharmony_ci  const Operator* ChangeInt31ToTaggedSigned();
8591cb0ef41Sopenharmony_ci  const Operator* ChangeInt32ToTagged();
8601cb0ef41Sopenharmony_ci  const Operator* ChangeInt64ToTagged();
8611cb0ef41Sopenharmony_ci  const Operator* ChangeUint32ToTagged();
8621cb0ef41Sopenharmony_ci  const Operator* ChangeUint64ToTagged();
8631cb0ef41Sopenharmony_ci  const Operator* ChangeFloat64ToTagged(CheckForMinusZeroMode);
8641cb0ef41Sopenharmony_ci  const Operator* ChangeFloat64ToTaggedPointer();
8651cb0ef41Sopenharmony_ci  const Operator* ChangeTaggedToBit();
8661cb0ef41Sopenharmony_ci  const Operator* ChangeBitToTagged();
8671cb0ef41Sopenharmony_ci  const Operator* TruncateBigIntToWord64();
8681cb0ef41Sopenharmony_ci  const Operator* ChangeInt64ToBigInt();
8691cb0ef41Sopenharmony_ci  const Operator* ChangeUint64ToBigInt();
8701cb0ef41Sopenharmony_ci  const Operator* TruncateTaggedToWord32();
8711cb0ef41Sopenharmony_ci  const Operator* TruncateTaggedToFloat64();
8721cb0ef41Sopenharmony_ci  const Operator* TruncateTaggedToBit();
8731cb0ef41Sopenharmony_ci  const Operator* TruncateTaggedPointerToBit();
8741cb0ef41Sopenharmony_ci
8751cb0ef41Sopenharmony_ci  const Operator* CompareMaps(ZoneHandleSet<Map>);
8761cb0ef41Sopenharmony_ci  const Operator* MapGuard(ZoneHandleSet<Map> maps);
8771cb0ef41Sopenharmony_ci
8781cb0ef41Sopenharmony_ci  const Operator* CheckBounds(const FeedbackSource& feedback,
8791cb0ef41Sopenharmony_ci                              CheckBoundsFlags flags = {});
8801cb0ef41Sopenharmony_ci  const Operator* CheckedUint32Bounds(const FeedbackSource& feedback,
8811cb0ef41Sopenharmony_ci                                      CheckBoundsFlags flags);
8821cb0ef41Sopenharmony_ci  const Operator* CheckedUint64Bounds(const FeedbackSource& feedback,
8831cb0ef41Sopenharmony_ci                                      CheckBoundsFlags flags);
8841cb0ef41Sopenharmony_ci
8851cb0ef41Sopenharmony_ci  const Operator* CheckClosure(const Handle<FeedbackCell>& feedback_cell);
8861cb0ef41Sopenharmony_ci  const Operator* CheckEqualsInternalizedString();
8871cb0ef41Sopenharmony_ci  const Operator* CheckEqualsSymbol();
8881cb0ef41Sopenharmony_ci  const Operator* CheckFloat64Hole(CheckFloat64HoleMode, FeedbackSource const&);
8891cb0ef41Sopenharmony_ci  const Operator* CheckHeapObject();
8901cb0ef41Sopenharmony_ci  const Operator* CheckIf(DeoptimizeReason deoptimize_reason,
8911cb0ef41Sopenharmony_ci                          const FeedbackSource& feedback = FeedbackSource());
8921cb0ef41Sopenharmony_ci  const Operator* CheckInternalizedString();
8931cb0ef41Sopenharmony_ci  const Operator* CheckMaps(CheckMapsFlags, ZoneHandleSet<Map>,
8941cb0ef41Sopenharmony_ci                            const FeedbackSource& = FeedbackSource());
8951cb0ef41Sopenharmony_ci  const Operator* CheckNotTaggedHole();
8961cb0ef41Sopenharmony_ci  const Operator* CheckNumber(const FeedbackSource& feedback);
8971cb0ef41Sopenharmony_ci  const Operator* CheckReceiver();
8981cb0ef41Sopenharmony_ci  const Operator* CheckReceiverOrNullOrUndefined();
8991cb0ef41Sopenharmony_ci  const Operator* CheckSmi(const FeedbackSource& feedback);
9001cb0ef41Sopenharmony_ci  const Operator* CheckString(const FeedbackSource& feedback);
9011cb0ef41Sopenharmony_ci  const Operator* CheckSymbol();
9021cb0ef41Sopenharmony_ci
9031cb0ef41Sopenharmony_ci  const Operator* CheckedFloat64ToInt32(CheckForMinusZeroMode,
9041cb0ef41Sopenharmony_ci                                        const FeedbackSource& feedback);
9051cb0ef41Sopenharmony_ci  const Operator* CheckedFloat64ToInt64(CheckForMinusZeroMode,
9061cb0ef41Sopenharmony_ci                                        const FeedbackSource& feedback);
9071cb0ef41Sopenharmony_ci  const Operator* CheckedInt32Add();
9081cb0ef41Sopenharmony_ci  const Operator* CheckedInt32Div();
9091cb0ef41Sopenharmony_ci  const Operator* CheckedInt32Mod();
9101cb0ef41Sopenharmony_ci  const Operator* CheckedInt32Mul(CheckForMinusZeroMode);
9111cb0ef41Sopenharmony_ci  const Operator* CheckedInt32Sub();
9121cb0ef41Sopenharmony_ci  const Operator* CheckedInt32ToTaggedSigned(const FeedbackSource& feedback);
9131cb0ef41Sopenharmony_ci  const Operator* CheckedInt64ToInt32(const FeedbackSource& feedback);
9141cb0ef41Sopenharmony_ci  const Operator* CheckedInt64ToTaggedSigned(const FeedbackSource& feedback);
9151cb0ef41Sopenharmony_ci  const Operator* CheckedTaggedSignedToInt32(const FeedbackSource& feedback);
9161cb0ef41Sopenharmony_ci  const Operator* CheckedTaggedToFloat64(CheckTaggedInputMode,
9171cb0ef41Sopenharmony_ci                                         const FeedbackSource& feedback);
9181cb0ef41Sopenharmony_ci  const Operator* CheckedTaggedToInt32(CheckForMinusZeroMode,
9191cb0ef41Sopenharmony_ci                                       const FeedbackSource& feedback);
9201cb0ef41Sopenharmony_ci  const Operator* CheckedTaggedToArrayIndex(const FeedbackSource& feedback);
9211cb0ef41Sopenharmony_ci  const Operator* CheckedTaggedToInt64(CheckForMinusZeroMode,
9221cb0ef41Sopenharmony_ci                                       const FeedbackSource& feedback);
9231cb0ef41Sopenharmony_ci  const Operator* CheckedTaggedToTaggedPointer(const FeedbackSource& feedback);
9241cb0ef41Sopenharmony_ci  const Operator* CheckedTaggedToTaggedSigned(const FeedbackSource& feedback);
9251cb0ef41Sopenharmony_ci  const Operator* CheckBigInt(const FeedbackSource& feedback);
9261cb0ef41Sopenharmony_ci  const Operator* CheckedTruncateTaggedToWord32(CheckTaggedInputMode,
9271cb0ef41Sopenharmony_ci                                                const FeedbackSource& feedback);
9281cb0ef41Sopenharmony_ci  const Operator* CheckedUint32Div();
9291cb0ef41Sopenharmony_ci  const Operator* CheckedUint32Mod();
9301cb0ef41Sopenharmony_ci  const Operator* CheckedUint32ToInt32(const FeedbackSource& feedback);
9311cb0ef41Sopenharmony_ci  const Operator* CheckedUint32ToTaggedSigned(const FeedbackSource& feedback);
9321cb0ef41Sopenharmony_ci  const Operator* CheckedUint64ToInt32(const FeedbackSource& feedback);
9331cb0ef41Sopenharmony_ci  const Operator* CheckedUint64ToTaggedSigned(const FeedbackSource& feedback);
9341cb0ef41Sopenharmony_ci
9351cb0ef41Sopenharmony_ci  const Operator* ConvertReceiver(ConvertReceiverMode);
9361cb0ef41Sopenharmony_ci
9371cb0ef41Sopenharmony_ci  const Operator* ConvertTaggedHoleToUndefined();
9381cb0ef41Sopenharmony_ci
9391cb0ef41Sopenharmony_ci  const Operator* ObjectIsArrayBufferView();
9401cb0ef41Sopenharmony_ci  const Operator* ObjectIsBigInt();
9411cb0ef41Sopenharmony_ci  const Operator* ObjectIsCallable();
9421cb0ef41Sopenharmony_ci  const Operator* ObjectIsConstructor();
9431cb0ef41Sopenharmony_ci  const Operator* ObjectIsDetectableCallable();
9441cb0ef41Sopenharmony_ci  const Operator* ObjectIsMinusZero();
9451cb0ef41Sopenharmony_ci  const Operator* NumberIsMinusZero();
9461cb0ef41Sopenharmony_ci  const Operator* ObjectIsNaN();
9471cb0ef41Sopenharmony_ci  const Operator* NumberIsNaN();
9481cb0ef41Sopenharmony_ci  const Operator* ObjectIsNonCallable();
9491cb0ef41Sopenharmony_ci  const Operator* ObjectIsNumber();
9501cb0ef41Sopenharmony_ci  const Operator* ObjectIsReceiver();
9511cb0ef41Sopenharmony_ci  const Operator* ObjectIsSmi();
9521cb0ef41Sopenharmony_ci  const Operator* ObjectIsString();
9531cb0ef41Sopenharmony_ci  const Operator* ObjectIsSymbol();
9541cb0ef41Sopenharmony_ci  const Operator* ObjectIsUndetectable();
9551cb0ef41Sopenharmony_ci
9561cb0ef41Sopenharmony_ci  const Operator* NumberIsFloat64Hole();
9571cb0ef41Sopenharmony_ci  const Operator* NumberIsFinite();
9581cb0ef41Sopenharmony_ci  const Operator* ObjectIsFiniteNumber();
9591cb0ef41Sopenharmony_ci  const Operator* NumberIsInteger();
9601cb0ef41Sopenharmony_ci  const Operator* ObjectIsSafeInteger();
9611cb0ef41Sopenharmony_ci  const Operator* NumberIsSafeInteger();
9621cb0ef41Sopenharmony_ci  const Operator* ObjectIsInteger();
9631cb0ef41Sopenharmony_ci
9641cb0ef41Sopenharmony_ci  const Operator* ArgumentsLength();
9651cb0ef41Sopenharmony_ci  const Operator* RestLength(int formal_parameter_count);
9661cb0ef41Sopenharmony_ci
9671cb0ef41Sopenharmony_ci  const Operator* NewDoubleElements(AllocationType);
9681cb0ef41Sopenharmony_ci  const Operator* NewSmiOrObjectElements(AllocationType);
9691cb0ef41Sopenharmony_ci
9701cb0ef41Sopenharmony_ci  // new-arguments-elements arguments-length
9711cb0ef41Sopenharmony_ci  const Operator* NewArgumentsElements(CreateArgumentsType type,
9721cb0ef41Sopenharmony_ci                                       int formal_parameter_count);
9731cb0ef41Sopenharmony_ci
9741cb0ef41Sopenharmony_ci  // new-cons-string length, first, second
9751cb0ef41Sopenharmony_ci  const Operator* NewConsString();
9761cb0ef41Sopenharmony_ci
9771cb0ef41Sopenharmony_ci  // ensure-writable-fast-elements object, elements
9781cb0ef41Sopenharmony_ci  const Operator* EnsureWritableFastElements();
9791cb0ef41Sopenharmony_ci
9801cb0ef41Sopenharmony_ci  // maybe-grow-fast-elements object, elements, index, length
9811cb0ef41Sopenharmony_ci  const Operator* MaybeGrowFastElements(GrowFastElementsMode mode,
9821cb0ef41Sopenharmony_ci                                        const FeedbackSource& feedback);
9831cb0ef41Sopenharmony_ci
9841cb0ef41Sopenharmony_ci  // transition-elements-kind object, from-map, to-map
9851cb0ef41Sopenharmony_ci  const Operator* TransitionElementsKind(ElementsTransition transition);
9861cb0ef41Sopenharmony_ci
9871cb0ef41Sopenharmony_ci  const Operator* Allocate(Type type,
9881cb0ef41Sopenharmony_ci                           AllocationType allocation = AllocationType::kYoung);
9891cb0ef41Sopenharmony_ci  const Operator* AllocateRaw(
9901cb0ef41Sopenharmony_ci      Type type, AllocationType allocation = AllocationType::kYoung,
9911cb0ef41Sopenharmony_ci      AllowLargeObjects allow_large_objects = AllowLargeObjects::kFalse);
9921cb0ef41Sopenharmony_ci
9931cb0ef41Sopenharmony_ci  const Operator* LoadMessage();
9941cb0ef41Sopenharmony_ci  const Operator* StoreMessage();
9951cb0ef41Sopenharmony_ci
9961cb0ef41Sopenharmony_ci  const Operator* LoadFieldByIndex();
9971cb0ef41Sopenharmony_ci  const Operator* LoadField(FieldAccess const&);
9981cb0ef41Sopenharmony_ci  const Operator* StoreField(FieldAccess const&,
9991cb0ef41Sopenharmony_ci                             bool maybe_initializing_or_transitioning = true);
10001cb0ef41Sopenharmony_ci
10011cb0ef41Sopenharmony_ci  // load-element [base + index]
10021cb0ef41Sopenharmony_ci  const Operator* LoadElement(ElementAccess const&);
10031cb0ef41Sopenharmony_ci
10041cb0ef41Sopenharmony_ci  // load-stack-argument [base + index]
10051cb0ef41Sopenharmony_ci  const Operator* LoadStackArgument();
10061cb0ef41Sopenharmony_ci
10071cb0ef41Sopenharmony_ci  // store-element [base + index], value
10081cb0ef41Sopenharmony_ci  const Operator* StoreElement(ElementAccess const&);
10091cb0ef41Sopenharmony_ci
10101cb0ef41Sopenharmony_ci  // store-element [base + index], value, only with fast arrays.
10111cb0ef41Sopenharmony_ci  const Operator* TransitionAndStoreElement(Handle<Map> double_map,
10121cb0ef41Sopenharmony_ci                                            Handle<Map> fast_map);
10131cb0ef41Sopenharmony_ci  // store-element [base + index], smi value, only with fast arrays.
10141cb0ef41Sopenharmony_ci  const Operator* StoreSignedSmallElement();
10151cb0ef41Sopenharmony_ci
10161cb0ef41Sopenharmony_ci  // store-element [base + index], double value, only with fast arrays.
10171cb0ef41Sopenharmony_ci  const Operator* TransitionAndStoreNumberElement(Handle<Map> double_map);
10181cb0ef41Sopenharmony_ci
10191cb0ef41Sopenharmony_ci  // store-element [base + index], object value, only with fast arrays.
10201cb0ef41Sopenharmony_ci  const Operator* TransitionAndStoreNonNumberElement(Handle<Map> fast_map,
10211cb0ef41Sopenharmony_ci                                                     Type value_type);
10221cb0ef41Sopenharmony_ci
10231cb0ef41Sopenharmony_ci  // load-from-object [base + offset]
10241cb0ef41Sopenharmony_ci  // This operator comes in two flavors: LoadImmutableFromObject guarantees that
10251cb0ef41Sopenharmony_ci  // the underlying object field will be initialized at most once for the
10261cb0ef41Sopenharmony_ci  // duration of the program. This enables more optimizations in
10271cb0ef41Sopenharmony_ci  // CsaLoadElimination.
10281cb0ef41Sopenharmony_ci  // Note: LoadImmutableFromObject is unrelated to LoadImmutable and is lowered
10291cb0ef41Sopenharmony_ci  // into a regular Load.
10301cb0ef41Sopenharmony_ci  const Operator* LoadFromObject(ObjectAccess const&);
10311cb0ef41Sopenharmony_ci  const Operator* LoadImmutableFromObject(ObjectAccess const&);
10321cb0ef41Sopenharmony_ci
10331cb0ef41Sopenharmony_ci  // store-to-object [base + offset], value
10341cb0ef41Sopenharmony_ci  // This operator comes in two flavors: InitializeImmutableInObject guarantees
10351cb0ef41Sopenharmony_ci  // that the underlying object field has not and will not be initialized again
10361cb0ef41Sopenharmony_ci  // for the duration of the program. This enables more optimizations in
10371cb0ef41Sopenharmony_ci  // CsaLoadElimination.
10381cb0ef41Sopenharmony_ci  const Operator* StoreToObject(ObjectAccess const&);
10391cb0ef41Sopenharmony_ci  const Operator* InitializeImmutableInObject(ObjectAccess const&);
10401cb0ef41Sopenharmony_ci
10411cb0ef41Sopenharmony_ci  // load-typed-element buffer, [base + external + index]
10421cb0ef41Sopenharmony_ci  const Operator* LoadTypedElement(ExternalArrayType const&);
10431cb0ef41Sopenharmony_ci
10441cb0ef41Sopenharmony_ci  // load-data-view-element object, [base + index]
10451cb0ef41Sopenharmony_ci  const Operator* LoadDataViewElement(ExternalArrayType const&);
10461cb0ef41Sopenharmony_ci
10471cb0ef41Sopenharmony_ci  // store-typed-element buffer, [base + external + index], value
10481cb0ef41Sopenharmony_ci  const Operator* StoreTypedElement(ExternalArrayType const&);
10491cb0ef41Sopenharmony_ci
10501cb0ef41Sopenharmony_ci  // store-data-view-element object, [base + index], value
10511cb0ef41Sopenharmony_ci  const Operator* StoreDataViewElement(ExternalArrayType const&);
10521cb0ef41Sopenharmony_ci
10531cb0ef41Sopenharmony_ci  // Abort (for terminating execution on internal error).
10541cb0ef41Sopenharmony_ci  const Operator* RuntimeAbort(AbortReason reason);
10551cb0ef41Sopenharmony_ci
10561cb0ef41Sopenharmony_ci  // Abort if the value input does not inhabit the given type
10571cb0ef41Sopenharmony_ci  const Operator* AssertType(Type type);
10581cb0ef41Sopenharmony_ci
10591cb0ef41Sopenharmony_ci  // Abort if the value does not match the node's computed type after
10601cb0ef41Sopenharmony_ci  // SimplifiedLowering.
10611cb0ef41Sopenharmony_ci  const Operator* VerifyType();
10621cb0ef41Sopenharmony_ci
10631cb0ef41Sopenharmony_ci  const Operator* DateNow();
10641cb0ef41Sopenharmony_ci
10651cb0ef41Sopenharmony_ci  // Represents the inputs necessary to construct a fast and a slow API call.
10661cb0ef41Sopenharmony_ci  const Operator* FastApiCall(
10671cb0ef41Sopenharmony_ci      const FastApiCallFunctionVector& c_candidate_functions,
10681cb0ef41Sopenharmony_ci      FeedbackSource const& feedback, CallDescriptor* descriptor);
10691cb0ef41Sopenharmony_ci
10701cb0ef41Sopenharmony_ci private:
10711cb0ef41Sopenharmony_ci  Zone* zone() const { return zone_; }
10721cb0ef41Sopenharmony_ci
10731cb0ef41Sopenharmony_ci  const SimplifiedOperatorGlobalCache& cache_;
10741cb0ef41Sopenharmony_ci  Zone* const zone_;
10751cb0ef41Sopenharmony_ci};
10761cb0ef41Sopenharmony_ci
10771cb0ef41Sopenharmony_ci// Node wrappers.
10781cb0ef41Sopenharmony_ci
10791cb0ef41Sopenharmony_ci// TODO(jgruber): Consider merging with JSNodeWrapperBase.
10801cb0ef41Sopenharmony_ciclass SimplifiedNodeWrapperBase : public NodeWrapper {
10811cb0ef41Sopenharmony_ci public:
10821cb0ef41Sopenharmony_ci  explicit constexpr SimplifiedNodeWrapperBase(Node* node)
10831cb0ef41Sopenharmony_ci      : NodeWrapper(node) {}
10841cb0ef41Sopenharmony_ci
10851cb0ef41Sopenharmony_ci  // Valid iff this node has a context input.
10861cb0ef41Sopenharmony_ci  TNode<Object> context() const {
10871cb0ef41Sopenharmony_ci    // Could be a Context or NoContextConstant.
10881cb0ef41Sopenharmony_ci    return TNode<Object>::UncheckedCast(
10891cb0ef41Sopenharmony_ci        NodeProperties::GetContextInput(node()));
10901cb0ef41Sopenharmony_ci  }
10911cb0ef41Sopenharmony_ci
10921cb0ef41Sopenharmony_ci  // Valid iff this node has exactly one effect input.
10931cb0ef41Sopenharmony_ci  Effect effect() const {
10941cb0ef41Sopenharmony_ci    DCHECK_EQ(node()->op()->EffectInputCount(), 1);
10951cb0ef41Sopenharmony_ci    return Effect{NodeProperties::GetEffectInput(node())};
10961cb0ef41Sopenharmony_ci  }
10971cb0ef41Sopenharmony_ci
10981cb0ef41Sopenharmony_ci  // Valid iff this node has exactly one control input.
10991cb0ef41Sopenharmony_ci  Control control() const {
11001cb0ef41Sopenharmony_ci    DCHECK_EQ(node()->op()->ControlInputCount(), 1);
11011cb0ef41Sopenharmony_ci    return Control{NodeProperties::GetControlInput(node())};
11021cb0ef41Sopenharmony_ci  }
11031cb0ef41Sopenharmony_ci
11041cb0ef41Sopenharmony_ci  // Valid iff this node has a frame state input.
11051cb0ef41Sopenharmony_ci  FrameState frame_state() const {
11061cb0ef41Sopenharmony_ci    return FrameState{NodeProperties::GetFrameStateInput(node())};
11071cb0ef41Sopenharmony_ci  }
11081cb0ef41Sopenharmony_ci};
11091cb0ef41Sopenharmony_ci
11101cb0ef41Sopenharmony_ci#define DEFINE_INPUT_ACCESSORS(Name, name, TheIndex, Type) \
11111cb0ef41Sopenharmony_ci  static constexpr int Name##Index() { return TheIndex; }  \
11121cb0ef41Sopenharmony_ci  TNode<Type> name() const {                               \
11131cb0ef41Sopenharmony_ci    return TNode<Type>::UncheckedCast(                     \
11141cb0ef41Sopenharmony_ci        NodeProperties::GetValueInput(node(), TheIndex));  \
11151cb0ef41Sopenharmony_ci  }
11161cb0ef41Sopenharmony_ci
11171cb0ef41Sopenharmony_ciclass FastApiCallNode final : public SimplifiedNodeWrapperBase {
11181cb0ef41Sopenharmony_ci public:
11191cb0ef41Sopenharmony_ci  explicit constexpr FastApiCallNode(Node* node)
11201cb0ef41Sopenharmony_ci      : SimplifiedNodeWrapperBase(node) {
11211cb0ef41Sopenharmony_ci    DCHECK_EQ(IrOpcode::kFastApiCall, node->opcode());
11221cb0ef41Sopenharmony_ci  }
11231cb0ef41Sopenharmony_ci
11241cb0ef41Sopenharmony_ci  const FastApiCallParameters& Parameters() const {
11251cb0ef41Sopenharmony_ci    return FastApiCallParametersOf(node()->op());
11261cb0ef41Sopenharmony_ci  }
11271cb0ef41Sopenharmony_ci
11281cb0ef41Sopenharmony_ci#define INPUTS(V) V(Receiver, receiver, 0, Object)
11291cb0ef41Sopenharmony_ci  INPUTS(DEFINE_INPUT_ACCESSORS)
11301cb0ef41Sopenharmony_ci#undef INPUTS
11311cb0ef41Sopenharmony_ci
11321cb0ef41Sopenharmony_ci  // Besides actual arguments, FastApiCall nodes also take:
11331cb0ef41Sopenharmony_ci  static constexpr int kSlowTargetInputCount = 1;
11341cb0ef41Sopenharmony_ci  static constexpr int kFastReceiverInputCount = 1;
11351cb0ef41Sopenharmony_ci  static constexpr int kSlowReceiverInputCount = 1;
11361cb0ef41Sopenharmony_ci  static constexpr int kExtraInputCount = kFastReceiverInputCount;
11371cb0ef41Sopenharmony_ci
11381cb0ef41Sopenharmony_ci  static constexpr int kArityInputCount = 1;
11391cb0ef41Sopenharmony_ci  static constexpr int kNewTargetInputCount = 1;
11401cb0ef41Sopenharmony_ci  static constexpr int kHolderInputCount = 1;
11411cb0ef41Sopenharmony_ci  static constexpr int kContextAndFrameStateInputCount = 2;
11421cb0ef41Sopenharmony_ci  static constexpr int kEffectAndControlInputCount = 2;
11431cb0ef41Sopenharmony_ci  int FastCallExtraInputCount() const;
11441cb0ef41Sopenharmony_ci  static constexpr int kSlowCallExtraInputCount =
11451cb0ef41Sopenharmony_ci      kSlowTargetInputCount + kArityInputCount + kNewTargetInputCount +
11461cb0ef41Sopenharmony_ci      kSlowReceiverInputCount + kHolderInputCount +
11471cb0ef41Sopenharmony_ci      kContextAndFrameStateInputCount + kEffectAndControlInputCount;
11481cb0ef41Sopenharmony_ci
11491cb0ef41Sopenharmony_ci  static constexpr int kSlowCallDataArgumentIndex = 3;
11501cb0ef41Sopenharmony_ci
11511cb0ef41Sopenharmony_ci  // This is the arity fed into FastApiCallArguments.
11521cb0ef41Sopenharmony_ci  static constexpr int ArityForArgc(int c_arg_count, int js_arg_count) {
11531cb0ef41Sopenharmony_ci    return c_arg_count + js_arg_count + kEffectAndControlInputCount;
11541cb0ef41Sopenharmony_ci  }
11551cb0ef41Sopenharmony_ci
11561cb0ef41Sopenharmony_ci  int FastCallArgumentCount() const;
11571cb0ef41Sopenharmony_ci  int SlowCallArgumentCount() const;
11581cb0ef41Sopenharmony_ci
11591cb0ef41Sopenharmony_ci  constexpr int FirstFastCallArgumentIndex() const {
11601cb0ef41Sopenharmony_ci    return ReceiverIndex() + 1;
11611cb0ef41Sopenharmony_ci  }
11621cb0ef41Sopenharmony_ci  constexpr int FastCallArgumentIndex(int i) const {
11631cb0ef41Sopenharmony_ci    return FirstFastCallArgumentIndex() + i;
11641cb0ef41Sopenharmony_ci  }
11651cb0ef41Sopenharmony_ci  TNode<Object> FastCallArgument(int i) const {
11661cb0ef41Sopenharmony_ci    DCHECK_LT(i, FastCallArgumentCount());
11671cb0ef41Sopenharmony_ci    return TNode<Object>::UncheckedCast(
11681cb0ef41Sopenharmony_ci        NodeProperties::GetValueInput(node(), FastCallArgumentIndex(i)));
11691cb0ef41Sopenharmony_ci  }
11701cb0ef41Sopenharmony_ci
11711cb0ef41Sopenharmony_ci  int FirstSlowCallArgumentIndex() const { return FastCallArgumentCount(); }
11721cb0ef41Sopenharmony_ci  int SlowCallArgumentIndex(int i) const {
11731cb0ef41Sopenharmony_ci    return FirstSlowCallArgumentIndex() + i;
11741cb0ef41Sopenharmony_ci  }
11751cb0ef41Sopenharmony_ci  TNode<Object> SlowCallArgument(int i) const {
11761cb0ef41Sopenharmony_ci    DCHECK_LT(i, SlowCallArgumentCount());
11771cb0ef41Sopenharmony_ci    return TNode<Object>::UncheckedCast(
11781cb0ef41Sopenharmony_ci        NodeProperties::GetValueInput(node(), SlowCallArgumentIndex(i)));
11791cb0ef41Sopenharmony_ci  }
11801cb0ef41Sopenharmony_ci};
11811cb0ef41Sopenharmony_ci
11821cb0ef41Sopenharmony_ci#undef DEFINE_INPUT_ACCESSORS
11831cb0ef41Sopenharmony_ci
11841cb0ef41Sopenharmony_ci}  // namespace compiler
11851cb0ef41Sopenharmony_ci}  // namespace internal
11861cb0ef41Sopenharmony_ci}  // namespace v8
11871cb0ef41Sopenharmony_ci
11881cb0ef41Sopenharmony_ci#endif  // V8_COMPILER_SIMPLIFIED_OPERATOR_H_
1189