LCOV - code coverage report
Current view: top level - src/compiler - simplified-operator.h (source / functions) Hit Total Coverage
Test: app.info Lines: 15 17 88.2 %
Date: 2019-01-20 Functions: 0 1 0.0 %

          Line data    Source code
       1             : // Copyright 2014 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_COMPILER_SIMPLIFIED_OPERATOR_H_
       6             : #define V8_COMPILER_SIMPLIFIED_OPERATOR_H_
       7             : 
       8             : #include <iosfwd>
       9             : 
      10             : #include "src/base/compiler-specific.h"
      11             : #include "src/compiler/operator.h"
      12             : #include "src/compiler/types.h"
      13             : #include "src/deoptimize-reason.h"
      14             : #include "src/globals.h"
      15             : #include "src/handles.h"
      16             : #include "src/machine-type.h"
      17             : #include "src/maybe-handles.h"
      18             : #include "src/objects.h"
      19             : #include "src/type-hints.h"
      20             : #include "src/vector-slot-pair.h"
      21             : #include "src/zone/zone-handle-set.h"
      22             : 
      23             : namespace v8 {
      24             : namespace internal {
      25             : 
      26             : // Forward declarations.
      27             : enum class AbortReason : uint8_t;
      28             : class Zone;
      29             : 
      30             : namespace compiler {
      31             : 
      32             : // Forward declarations.
      33             : class Operator;
      34             : struct SimplifiedOperatorGlobalCache;
      35             : 
      36             : enum BaseTaggedness : uint8_t { kUntaggedBase, kTaggedBase };
      37             : 
      38             : size_t hash_value(BaseTaggedness);
      39             : 
      40             : std::ostream& operator<<(std::ostream&, BaseTaggedness);
      41             : 
      42             : size_t hash_value(LoadSensitivity);
      43             : 
      44             : std::ostream& operator<<(std::ostream&, LoadSensitivity);
      45             : 
      46             : // An access descriptor for loads/stores of fixed structures like field
      47             : // accesses of heap objects. Accesses from either tagged or untagged base
      48             : // pointers are supported; untagging is done automatically during lowering.
      49             : struct FieldAccess {
      50             :   BaseTaggedness base_is_tagged;  // specifies if the base pointer is tagged.
      51             :   int offset;                     // offset of the field, without tag.
      52             :   MaybeHandle<Name> name;         // debugging only.
      53             :   MaybeHandle<Map> map;           // map of the field value (if known).
      54             :   Type type;                      // type of the field.
      55             :   MachineType machine_type;       // machine type of the field.
      56             :   WriteBarrierKind write_barrier_kind;  // write barrier hint.
      57             :   LoadSensitivity load_sensitivity;     // load safety for poisoning.
      58             : 
      59             :   FieldAccess()
      60             :       : base_is_tagged(kTaggedBase),
      61             :         offset(0),
      62             :         type(Type::None()),
      63             :         machine_type(MachineType::None()),
      64             :         write_barrier_kind(kFullWriteBarrier),
      65        7095 :         load_sensitivity(LoadSensitivity::kUnsafe) {}
      66             : 
      67             :   FieldAccess(BaseTaggedness base_is_tagged, int offset, MaybeHandle<Name> name,
      68             :               MaybeHandle<Map> map, Type type, MachineType machine_type,
      69             :               WriteBarrierKind write_barrier_kind,
      70             :               LoadSensitivity load_sensitivity = LoadSensitivity::kUnsafe)
      71             :       : base_is_tagged(base_is_tagged),
      72             :         offset(offset),
      73             :         name(name),
      74             :         map(map),
      75             :         type(type),
      76             :         machine_type(machine_type),
      77             :         write_barrier_kind(write_barrier_kind),
      78     3404656 :         load_sensitivity(load_sensitivity) {}
      79             : 
      80     9451351 :   int tag() const { return base_is_tagged == kTaggedBase ? kHeapObjectTag : 0; }
      81             : };
      82             : 
      83             : V8_EXPORT_PRIVATE bool operator==(FieldAccess const&, FieldAccess const&);
      84             : 
      85             : size_t hash_value(FieldAccess const&);
      86             : 
      87             : V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, FieldAccess const&);
      88             : 
      89             : V8_EXPORT_PRIVATE FieldAccess const& FieldAccessOf(const Operator* op)
      90             :     V8_WARN_UNUSED_RESULT;
      91             : 
      92             : template <>
      93             : void Operator1<FieldAccess>::PrintParameter(std::ostream& os,
      94             :                                             PrintVerbosity verbose) const;
      95             : 
      96             : // An access descriptor for loads/stores of indexed structures like characters
      97             : // in strings or off-heap backing stores. Accesses from either tagged or
      98             : // untagged base pointers are supported; untagging is done automatically during
      99             : // lowering.
     100             : struct ElementAccess {
     101             :   BaseTaggedness base_is_tagged;  // specifies if the base pointer is tagged.
     102             :   int header_size;                // size of the header, without tag.
     103             :   Type type;                      // type of the element.
     104             :   MachineType machine_type;       // machine type of the element.
     105             :   WriteBarrierKind write_barrier_kind;  // write barrier hint.
     106             :   LoadSensitivity load_sensitivity;     // load safety for poisoning.
     107             : 
     108             :   ElementAccess()
     109             :       : base_is_tagged(kTaggedBase),
     110             :         header_size(0),
     111             :         type(Type::None()),
     112             :         machine_type(MachineType::None()),
     113             :         write_barrier_kind(kFullWriteBarrier),
     114        3094 :         load_sensitivity(LoadSensitivity::kUnsafe) {}
     115             : 
     116             :   ElementAccess(BaseTaggedness base_is_tagged, int header_size, Type type,
     117             :                 MachineType machine_type, WriteBarrierKind write_barrier_kind,
     118             :                 LoadSensitivity load_sensitivity = LoadSensitivity::kUnsafe)
     119             :       : base_is_tagged(base_is_tagged),
     120             :         header_size(header_size),
     121             :         type(type),
     122             :         machine_type(machine_type),
     123             :         write_barrier_kind(write_barrier_kind),
     124       53249 :         load_sensitivity(load_sensitivity) {}
     125             : 
     126      266039 :   int tag() const { return base_is_tagged == kTaggedBase ? kHeapObjectTag : 0; }
     127             : };
     128             : 
     129             : V8_EXPORT_PRIVATE bool operator==(ElementAccess const&, ElementAccess const&);
     130             : 
     131             : size_t hash_value(ElementAccess const&);
     132             : 
     133             : V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, ElementAccess const&);
     134             : 
     135             : V8_EXPORT_PRIVATE ElementAccess const& ElementAccessOf(const Operator* op)
     136             :     V8_WARN_UNUSED_RESULT;
     137             : 
     138             : ExternalArrayType ExternalArrayTypeOf(const Operator* op) V8_WARN_UNUSED_RESULT;
     139             : 
     140             : // The ConvertReceiverMode is used as parameter by ConvertReceiver operators.
     141             : ConvertReceiverMode ConvertReceiverModeOf(Operator const* op)
     142             :     V8_WARN_UNUSED_RESULT;
     143             : 
     144             : // A the parameters for several Check nodes. The {feedback} parameter is
     145             : // optional. If {feedback} references a valid CallIC slot and this MapCheck
     146             : // fails, then speculation on that CallIC slot will be disabled.
     147             : class CheckParameters final {
     148             :  public:
     149             :   explicit CheckParameters(const VectorSlotPair& feedback)
     150      514772 :       : feedback_(feedback) {}
     151             : 
     152             :   VectorSlotPair const& feedback() const { return feedback_; }
     153             : 
     154             :  private:
     155             :   VectorSlotPair feedback_;
     156             : };
     157             : 
     158             : bool operator==(CheckParameters const&, CheckParameters const&);
     159             : 
     160             : size_t hash_value(CheckParameters const&);
     161             : 
     162             : std::ostream& operator<<(std::ostream&, CheckParameters const&);
     163             : 
     164             : CheckParameters const& CheckParametersOf(Operator const*) V8_WARN_UNUSED_RESULT;
     165             : 
     166             : class CheckIfParameters final {
     167             :  public:
     168             :   explicit CheckIfParameters(DeoptimizeReason reason,
     169             :                              const VectorSlotPair& feedback)
     170     1235345 :       : reason_(reason), feedback_(feedback) {}
     171             : 
     172             :   VectorSlotPair const& feedback() const { return feedback_; }
     173             :   DeoptimizeReason reason() const { return reason_; }
     174             : 
     175             :  private:
     176             :   DeoptimizeReason reason_;
     177             :   VectorSlotPair feedback_;
     178             : };
     179             : 
     180             : bool operator==(CheckIfParameters const&, CheckIfParameters const&);
     181             : 
     182             : size_t hash_value(CheckIfParameters const&);
     183             : 
     184             : std::ostream& operator<<(std::ostream&, CheckIfParameters const&);
     185             : 
     186             : CheckIfParameters const& CheckIfParametersOf(Operator const*)
     187             :     V8_WARN_UNUSED_RESULT;
     188             : 
     189             : enum class CheckFloat64HoleMode : uint8_t {
     190             :   kNeverReturnHole,  // Never return the hole (deoptimize instead).
     191             :   kAllowReturnHole   // Allow to return the hole (signaling NaN).
     192             : };
     193             : 
     194             : size_t hash_value(CheckFloat64HoleMode);
     195             : 
     196             : std::ostream& operator<<(std::ostream&, CheckFloat64HoleMode);
     197             : 
     198             : class CheckFloat64HoleParameters {
     199             :  public:
     200             :   CheckFloat64HoleParameters(CheckFloat64HoleMode mode,
     201             :                              VectorSlotPair const& feedback)
     202       61753 :       : mode_(mode), feedback_(feedback) {}
     203             : 
     204             :   CheckFloat64HoleMode mode() const { return mode_; }
     205             :   VectorSlotPair const& feedback() const { return feedback_; }
     206             : 
     207             :  private:
     208             :   CheckFloat64HoleMode mode_;
     209             :   VectorSlotPair feedback_;
     210             : };
     211             : 
     212             : CheckFloat64HoleParameters const& CheckFloat64HoleParametersOf(Operator const*)
     213             :     V8_WARN_UNUSED_RESULT;
     214             : 
     215             : std::ostream& operator<<(std::ostream&, CheckFloat64HoleParameters const&);
     216             : 
     217             : size_t hash_value(CheckFloat64HoleParameters const&);
     218             : 
     219             : bool operator==(CheckFloat64HoleParameters const&,
     220             :                 CheckFloat64HoleParameters const&);
     221             : bool operator!=(CheckFloat64HoleParameters const&,
     222             :                 CheckFloat64HoleParameters const&);
     223             : 
     224             : enum class CheckTaggedInputMode : uint8_t {
     225             :   kNumber,
     226             :   kNumberOrOddball,
     227             : };
     228             : 
     229             : size_t hash_value(CheckTaggedInputMode);
     230             : 
     231             : V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, CheckTaggedInputMode);
     232             : 
     233             : class CheckTaggedInputParameters {
     234             :  public:
     235             :   CheckTaggedInputParameters(CheckTaggedInputMode mode,
     236             :                              const VectorSlotPair& feedback)
     237      162503 :       : mode_(mode), feedback_(feedback) {}
     238             : 
     239             :   CheckTaggedInputMode mode() const { return mode_; }
     240             :   const VectorSlotPair& feedback() const { return feedback_; }
     241             : 
     242             :  private:
     243             :   CheckTaggedInputMode mode_;
     244             :   VectorSlotPair feedback_;
     245             : };
     246             : 
     247             : const CheckTaggedInputParameters& CheckTaggedInputParametersOf(const Operator*)
     248             :     V8_WARN_UNUSED_RESULT;
     249             : 
     250             : std::ostream& operator<<(std::ostream&,
     251             :                          const CheckTaggedInputParameters& params);
     252             : 
     253             : size_t hash_value(const CheckTaggedInputParameters& params);
     254             : 
     255             : bool operator==(CheckTaggedInputParameters const&,
     256             :                 CheckTaggedInputParameters const&);
     257             : 
     258             : enum class CheckForMinusZeroMode : uint8_t {
     259             :   kCheckForMinusZero,
     260             :   kDontCheckForMinusZero,
     261             : };
     262             : 
     263             : size_t hash_value(CheckForMinusZeroMode);
     264             : 
     265             : V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&,
     266             :                                            CheckForMinusZeroMode);
     267             : 
     268             : CheckForMinusZeroMode CheckMinusZeroModeOf(const Operator*)
     269             :     V8_WARN_UNUSED_RESULT;
     270             : 
     271             : class CheckMinusZeroParameters {
     272             :  public:
     273             :   CheckMinusZeroParameters(CheckForMinusZeroMode mode,
     274             :                            const VectorSlotPair& feedback)
     275      247498 :       : mode_(mode), feedback_(feedback) {}
     276             : 
     277             :   CheckForMinusZeroMode mode() const { return mode_; }
     278             :   const VectorSlotPair& feedback() const { return feedback_; }
     279             : 
     280             :  private:
     281             :   CheckForMinusZeroMode mode_;
     282             :   VectorSlotPair feedback_;
     283             : };
     284             : 
     285             : const CheckMinusZeroParameters& CheckMinusZeroParametersOf(const Operator* op)
     286             :     V8_WARN_UNUSED_RESULT;
     287             : 
     288             : std::ostream& operator<<(std::ostream&, const CheckMinusZeroParameters& params);
     289             : 
     290             : size_t hash_value(const CheckMinusZeroParameters& params);
     291             : 
     292             : bool operator==(CheckMinusZeroParameters const&,
     293             :                 CheckMinusZeroParameters const&);
     294             : 
     295             : // Flags for map checks.
     296             : enum class CheckMapsFlag : uint8_t {
     297             :   kNone = 0u,
     298             :   kTryMigrateInstance = 1u << 0,  // Try instance migration.
     299             : };
     300             : typedef base::Flags<CheckMapsFlag> CheckMapsFlags;
     301             : 
     302             : DEFINE_OPERATORS_FOR_FLAGS(CheckMapsFlags)
     303             : 
     304             : std::ostream& operator<<(std::ostream&, CheckMapsFlags);
     305             : 
     306             : class MapsParameterInfo {
     307             :  public:
     308             :   explicit MapsParameterInfo(ZoneHandleSet<Map> const& maps);
     309             : 
     310             :   Maybe<InstanceType> instance_type() const { return instance_type_; }
     311             :   ZoneHandleSet<Map> const& maps() const { return maps_; }
     312             : 
     313             :  private:
     314             :   ZoneHandleSet<Map> const maps_;
     315             :   Maybe<InstanceType> instance_type_;
     316             : };
     317             : 
     318             : std::ostream& operator<<(std::ostream&, MapsParameterInfo const&);
     319             : 
     320             : bool operator==(MapsParameterInfo const&, MapsParameterInfo const&);
     321             : bool operator!=(MapsParameterInfo const&, MapsParameterInfo const&);
     322             : 
     323             : size_t hash_value(MapsParameterInfo const&);
     324             : 
     325             : // A descriptor for map checks. The {feedback} parameter is optional.
     326             : // If {feedback} references a valid CallIC slot and this MapCheck fails,
     327             : // then speculation on that CallIC slot will be disabled.
     328             : class CheckMapsParameters final {
     329             :  public:
     330             :   CheckMapsParameters(CheckMapsFlags flags, ZoneHandleSet<Map> const& maps,
     331             :                       const VectorSlotPair& feedback)
     332       94303 :       : flags_(flags), maps_info_(maps), feedback_(feedback) {}
     333             : 
     334             :   CheckMapsFlags flags() const { return flags_; }
     335             :   ZoneHandleSet<Map> const& maps() const { return maps_info_.maps(); }
     336             :   MapsParameterInfo const& maps_info() const { return maps_info_; }
     337             :   VectorSlotPair const& feedback() const { return feedback_; }
     338             : 
     339             :  private:
     340             :   CheckMapsFlags const flags_;
     341             :   MapsParameterInfo const maps_info_;
     342             :   VectorSlotPair const feedback_;
     343             : };
     344             : 
     345             : bool operator==(CheckMapsParameters const&, CheckMapsParameters const&);
     346             : 
     347             : size_t hash_value(CheckMapsParameters const&);
     348             : 
     349             : std::ostream& operator<<(std::ostream&, CheckMapsParameters const&);
     350             : 
     351             : CheckMapsParameters const& CheckMapsParametersOf(Operator const*)
     352             :     V8_WARN_UNUSED_RESULT;
     353             : 
     354             : MapsParameterInfo const& MapGuardMapsOf(Operator const*) V8_WARN_UNUSED_RESULT;
     355             : 
     356             : // Parameters for CompareMaps operator.
     357             : MapsParameterInfo const& CompareMapsParametersOf(Operator const*)
     358             :     V8_WARN_UNUSED_RESULT;
     359             : 
     360             : // A descriptor for growing elements backing stores.
     361             : enum class GrowFastElementsMode : uint8_t {
     362             :   kDoubleElements,
     363             :   kSmiOrObjectElements
     364             : };
     365             : 
     366           0 : inline size_t hash_value(GrowFastElementsMode mode) {
     367           0 :   return static_cast<uint8_t>(mode);
     368             : }
     369             : 
     370             : std::ostream& operator<<(std::ostream&, GrowFastElementsMode);
     371             : 
     372             : class GrowFastElementsParameters {
     373             :  public:
     374             :   GrowFastElementsParameters(GrowFastElementsMode mode,
     375             :                              const VectorSlotPair& feedback)
     376       63632 :       : mode_(mode), feedback_(feedback) {}
     377             : 
     378             :   GrowFastElementsMode mode() const { return mode_; }
     379             :   const VectorSlotPair& feedback() const { return feedback_; }
     380             : 
     381             :  private:
     382             :   GrowFastElementsMode mode_;
     383             :   VectorSlotPair feedback_;
     384             : };
     385             : 
     386             : bool operator==(const GrowFastElementsParameters&,
     387             :                 const GrowFastElementsParameters&);
     388             : 
     389             : inline size_t hash_value(const GrowFastElementsParameters&);
     390             : 
     391             : std::ostream& operator<<(std::ostream&, const GrowFastElementsParameters&);
     392             : 
     393             : const GrowFastElementsParameters& GrowFastElementsParametersOf(const Operator*)
     394             :     V8_WARN_UNUSED_RESULT;
     395             : 
     396             : // A descriptor for elements kind transitions.
     397             : class ElementsTransition final {
     398             :  public:
     399             :   enum Mode : uint8_t {
     400             :     kFastTransition,  // simple transition, just updating the map.
     401             :     kSlowTransition   // full transition, round-trip to the runtime.
     402             :   };
     403             : 
     404             :   ElementsTransition(Mode mode, Handle<Map> source, Handle<Map> target)
     405         538 :       : mode_(mode), source_(source), target_(target) {}
     406             : 
     407             :   Mode mode() const { return mode_; }
     408             :   Handle<Map> source() const { return source_; }
     409             :   Handle<Map> target() const { return target_; }
     410             : 
     411             :  private:
     412             :   Mode const mode_;
     413             :   Handle<Map> const source_;
     414             :   Handle<Map> const target_;
     415             : };
     416             : 
     417             : bool operator==(ElementsTransition const&, ElementsTransition const&);
     418             : 
     419             : size_t hash_value(ElementsTransition);
     420             : 
     421             : std::ostream& operator<<(std::ostream&, ElementsTransition);
     422             : 
     423             : ElementsTransition const& ElementsTransitionOf(const Operator* op)
     424             :     V8_WARN_UNUSED_RESULT;
     425             : 
     426             : // Parameters for TransitionAndStoreElement, or
     427             : // TransitionAndStoreNonNumberElement, or
     428             : // TransitionAndStoreNumberElement.
     429             : Handle<Map> DoubleMapParameterOf(const Operator* op) V8_WARN_UNUSED_RESULT;
     430             : Handle<Map> FastMapParameterOf(const Operator* op) V8_WARN_UNUSED_RESULT;
     431             : 
     432             : // Parameters for TransitionAndStoreNonNumberElement.
     433             : Type ValueTypeParameterOf(const Operator* op) V8_WARN_UNUSED_RESULT;
     434             : 
     435             : // A hint for speculative number operations.
     436             : enum class NumberOperationHint : uint8_t {
     437             :   kSignedSmall,        // Inputs were Smi, output was in Smi.
     438             :   kSignedSmallInputs,  // Inputs were Smi, output was Number.
     439             :   kSigned32,           // Inputs were Signed32, output was Number.
     440             :   kNumber,             // Inputs were Number, output was Number.
     441             :   kNumberOrOddball,    // Inputs were Number or Oddball, output was Number.
     442             : };
     443             : 
     444             : size_t hash_value(NumberOperationHint);
     445             : 
     446             : V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, NumberOperationHint);
     447             : 
     448             : V8_EXPORT_PRIVATE NumberOperationHint NumberOperationHintOf(const Operator* op)
     449             :     V8_WARN_UNUSED_RESULT;
     450             : 
     451             : class NumberOperationParameters {
     452             :  public:
     453             :   NumberOperationParameters(NumberOperationHint hint,
     454             :                             const VectorSlotPair& feedback)
     455      188991 :       : hint_(hint), feedback_(feedback) {}
     456             : 
     457             :   NumberOperationHint hint() const { return hint_; }
     458             :   const VectorSlotPair& feedback() const { return feedback_; }
     459             : 
     460             :  private:
     461             :   NumberOperationHint hint_;
     462             :   VectorSlotPair feedback_;
     463             : };
     464             : 
     465             : size_t hash_value(NumberOperationParameters const&);
     466             : V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&,
     467             :                                            const NumberOperationParameters&);
     468             : bool operator==(NumberOperationParameters const&,
     469             :                 NumberOperationParameters const&);
     470             : const NumberOperationParameters& NumberOperationParametersOf(const Operator* op)
     471             :     V8_WARN_UNUSED_RESULT;
     472             : 
     473             : int FormalParameterCountOf(const Operator* op) V8_WARN_UNUSED_RESULT;
     474             : bool IsRestLengthOf(const Operator* op) V8_WARN_UNUSED_RESULT;
     475             : 
     476             : class AllocateParameters {
     477             :  public:
     478             :   AllocateParameters(Type type, PretenureFlag pretenure)
     479             :       : type_(type), pretenure_(pretenure) {}
     480             : 
     481             :   Type type() const { return type_; }
     482             :   PretenureFlag pretenure() const { return pretenure_; }
     483             : 
     484             :  private:
     485             :   Type type_;
     486             :   PretenureFlag pretenure_;
     487             : };
     488             : 
     489             : bool IsCheckedWithFeedback(const Operator* op);
     490             : 
     491             : size_t hash_value(AllocateParameters);
     492             : 
     493             : V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, AllocateParameters);
     494             : 
     495             : bool operator==(AllocateParameters const&, AllocateParameters const&);
     496             : 
     497             : PretenureFlag PretenureFlagOf(const Operator* op) V8_WARN_UNUSED_RESULT;
     498             : 
     499             : Type AllocateTypeOf(const Operator* op) V8_WARN_UNUSED_RESULT;
     500             : 
     501             : UnicodeEncoding UnicodeEncodingOf(const Operator*) V8_WARN_UNUSED_RESULT;
     502             : 
     503             : AbortReason AbortReasonOf(const Operator* op) V8_WARN_UNUSED_RESULT;
     504             : 
     505             : DeoptimizeReason DeoptimizeReasonOf(const Operator* op) V8_WARN_UNUSED_RESULT;
     506             : 
     507             : int NewArgumentsElementsMappedCountOf(const Operator* op) V8_WARN_UNUSED_RESULT;
     508             : 
     509             : // Interface for building simplified operators, which represent the
     510             : // medium-level operations of V8, including adding numbers, allocating objects,
     511             : // indexing into objects and arrays, etc.
     512             : // All operators are typed but many are representation independent.
     513             : 
     514             : // Number values from JS can be in one of these representations:
     515             : //   - Tagged: word-sized integer that is either
     516             : //     - a signed small integer (31 or 32 bits plus a tag)
     517             : //     - a tagged pointer to a HeapNumber object that has a float64 field
     518             : //   - Int32: an untagged signed 32-bit integer
     519             : //   - Uint32: an untagged unsigned 32-bit integer
     520             : //   - Float64: an untagged float64
     521             : 
     522             : // Additional representations for intermediate code or non-JS code:
     523             : //   - Int64: an untagged signed 64-bit integer
     524             : //   - Uint64: an untagged unsigned 64-bit integer
     525             : //   - Float32: an untagged float32
     526             : 
     527             : // Boolean values can be:
     528             : //   - Bool: a tagged pointer to either the canonical JS #false or
     529             : //           the canonical JS #true object
     530             : //   - Bit: an untagged integer 0 or 1, but word-sized
     531             : class V8_EXPORT_PRIVATE SimplifiedOperatorBuilder final
     532             :     : public NON_EXPORTED_BASE(ZoneObject) {
     533             :  public:
     534             :   explicit SimplifiedOperatorBuilder(Zone* zone);
     535             : 
     536             :   const Operator* BooleanNot();
     537             : 
     538             :   const Operator* NumberEqual();
     539             :   const Operator* NumberLessThan();
     540             :   const Operator* NumberLessThanOrEqual();
     541             :   const Operator* NumberAdd();
     542             :   const Operator* NumberSubtract();
     543             :   const Operator* NumberMultiply();
     544             :   const Operator* NumberDivide();
     545             :   const Operator* NumberModulus();
     546             :   const Operator* NumberBitwiseOr();
     547             :   const Operator* NumberBitwiseXor();
     548             :   const Operator* NumberBitwiseAnd();
     549             :   const Operator* NumberShiftLeft();
     550             :   const Operator* NumberShiftRight();
     551             :   const Operator* NumberShiftRightLogical();
     552             :   const Operator* NumberImul();
     553             :   const Operator* NumberAbs();
     554             :   const Operator* NumberClz32();
     555             :   const Operator* NumberCeil();
     556             :   const Operator* NumberFloor();
     557             :   const Operator* NumberFround();
     558             :   const Operator* NumberAcos();
     559             :   const Operator* NumberAcosh();
     560             :   const Operator* NumberAsin();
     561             :   const Operator* NumberAsinh();
     562             :   const Operator* NumberAtan();
     563             :   const Operator* NumberAtan2();
     564             :   const Operator* NumberAtanh();
     565             :   const Operator* NumberCbrt();
     566             :   const Operator* NumberCos();
     567             :   const Operator* NumberCosh();
     568             :   const Operator* NumberExp();
     569             :   const Operator* NumberExpm1();
     570             :   const Operator* NumberLog();
     571             :   const Operator* NumberLog1p();
     572             :   const Operator* NumberLog10();
     573             :   const Operator* NumberLog2();
     574             :   const Operator* NumberMax();
     575             :   const Operator* NumberMin();
     576             :   const Operator* NumberPow();
     577             :   const Operator* NumberRound();
     578             :   const Operator* NumberSign();
     579             :   const Operator* NumberSin();
     580             :   const Operator* NumberSinh();
     581             :   const Operator* NumberSqrt();
     582             :   const Operator* NumberTan();
     583             :   const Operator* NumberTanh();
     584             :   const Operator* NumberTrunc();
     585             :   const Operator* NumberToBoolean();
     586             :   const Operator* NumberToInt32();
     587             :   const Operator* NumberToString();
     588             :   const Operator* NumberToUint32();
     589             :   const Operator* NumberToUint8Clamped();
     590             : 
     591             :   const Operator* NumberSilenceNaN();
     592             : 
     593             :   const Operator* SpeculativeSafeIntegerAdd(NumberOperationHint hint);
     594             :   const Operator* SpeculativeSafeIntegerSubtract(NumberOperationHint hint);
     595             : 
     596             :   const Operator* SpeculativeNumberAdd(NumberOperationHint hint);
     597             :   const Operator* SpeculativeNumberSubtract(NumberOperationHint hint);
     598             :   const Operator* SpeculativeNumberMultiply(NumberOperationHint hint);
     599             :   const Operator* SpeculativeNumberDivide(NumberOperationHint hint);
     600             :   const Operator* SpeculativeNumberModulus(NumberOperationHint hint);
     601             :   const Operator* SpeculativeNumberShiftLeft(NumberOperationHint hint);
     602             :   const Operator* SpeculativeNumberShiftRight(NumberOperationHint hint);
     603             :   const Operator* SpeculativeNumberShiftRightLogical(NumberOperationHint hint);
     604             :   const Operator* SpeculativeNumberBitwiseAnd(NumberOperationHint hint);
     605             :   const Operator* SpeculativeNumberBitwiseOr(NumberOperationHint hint);
     606             :   const Operator* SpeculativeNumberBitwiseXor(NumberOperationHint hint);
     607             : 
     608             :   const Operator* SpeculativeNumberLessThan(NumberOperationHint hint);
     609             :   const Operator* SpeculativeNumberLessThanOrEqual(NumberOperationHint hint);
     610             :   const Operator* SpeculativeNumberEqual(NumberOperationHint hint);
     611             : 
     612             :   const Operator* ReferenceEqual();
     613             :   const Operator* SameValue();
     614             : 
     615             :   const Operator* TypeOf();
     616             : 
     617             :   const Operator* ToBoolean();
     618             : 
     619             :   const Operator* StringConcat();
     620             :   const Operator* StringEqual();
     621             :   const Operator* StringLessThan();
     622             :   const Operator* StringLessThanOrEqual();
     623             :   const Operator* StringCharCodeAt();
     624             :   const Operator* StringCodePointAt(UnicodeEncoding encoding);
     625             :   const Operator* StringFromSingleCharCode();
     626             :   const Operator* StringFromSingleCodePoint(UnicodeEncoding encoding);
     627             :   const Operator* StringIndexOf();
     628             :   const Operator* StringLength();
     629             :   const Operator* StringToLowerCaseIntl();
     630             :   const Operator* StringToUpperCaseIntl();
     631             :   const Operator* StringSubstring();
     632             : 
     633             :   const Operator* FindOrderedHashMapEntry();
     634             :   const Operator* FindOrderedHashMapEntryForInt32Key();
     635             : 
     636             :   const Operator* SpeculativeToNumber(NumberOperationHint hint,
     637             :                                       const VectorSlotPair& feedback);
     638             : 
     639             :   const Operator* StringToNumber();
     640             :   const Operator* PlainPrimitiveToNumber();
     641             :   const Operator* PlainPrimitiveToWord32();
     642             :   const Operator* PlainPrimitiveToFloat64();
     643             : 
     644             :   const Operator* ChangeTaggedSignedToInt32();
     645             :   const Operator* ChangeTaggedSignedToInt64();
     646             :   const Operator* ChangeTaggedToInt32();
     647             :   const Operator* ChangeTaggedToInt64();
     648             :   const Operator* ChangeTaggedToUint32();
     649             :   const Operator* ChangeTaggedToFloat64();
     650             :   const Operator* ChangeTaggedToTaggedSigned();
     651             :   const Operator* ChangeInt31ToTaggedSigned();
     652             :   const Operator* ChangeInt32ToTagged();
     653             :   const Operator* ChangeInt64ToTagged();
     654             :   const Operator* ChangeUint32ToTagged();
     655             :   const Operator* ChangeUint64ToTagged();
     656             :   const Operator* ChangeFloat64ToTagged(CheckForMinusZeroMode);
     657             :   const Operator* ChangeFloat64ToTaggedPointer();
     658             :   const Operator* ChangeTaggedToBit();
     659             :   const Operator* ChangeBitToTagged();
     660             :   const Operator* TruncateTaggedToWord32();
     661             :   const Operator* TruncateTaggedToFloat64();
     662             :   const Operator* TruncateTaggedToBit();
     663             :   const Operator* TruncateTaggedPointerToBit();
     664             : 
     665             :   const Operator* PoisonIndex();
     666             :   const Operator* CompareMaps(ZoneHandleSet<Map>);
     667             :   const Operator* MapGuard(ZoneHandleSet<Map> maps);
     668             : 
     669             :   const Operator* CheckBounds(const VectorSlotPair& feedback);
     670             :   const Operator* CheckEqualsInternalizedString();
     671             :   const Operator* CheckEqualsSymbol();
     672             :   const Operator* CheckFloat64Hole(CheckFloat64HoleMode, VectorSlotPair const&);
     673             :   const Operator* CheckHeapObject();
     674             :   const Operator* CheckIf(DeoptimizeReason deoptimize_reason,
     675             :                           const VectorSlotPair& feedback = VectorSlotPair());
     676             :   const Operator* CheckInternalizedString();
     677             :   const Operator* CheckMaps(CheckMapsFlags, ZoneHandleSet<Map>,
     678             :                             const VectorSlotPair& = VectorSlotPair());
     679             :   const Operator* CheckNotTaggedHole();
     680             :   const Operator* CheckNumber(const VectorSlotPair& feedback);
     681             :   const Operator* CheckReceiver();
     682             :   const Operator* CheckReceiverOrNullOrUndefined();
     683             :   const Operator* CheckSmi(const VectorSlotPair& feedback);
     684             :   const Operator* CheckString(const VectorSlotPair& feedback);
     685             :   const Operator* CheckSymbol();
     686             : 
     687             :   const Operator* CheckedFloat64ToInt32(CheckForMinusZeroMode,
     688             :                                         const VectorSlotPair& feedback);
     689             :   const Operator* CheckedFloat64ToInt64(CheckForMinusZeroMode,
     690             :                                         const VectorSlotPair& feedback);
     691             :   const Operator* CheckedInt32Add();
     692             :   const Operator* CheckedInt32Div();
     693             :   const Operator* CheckedInt32Mod();
     694             :   const Operator* CheckedInt32Mul(CheckForMinusZeroMode);
     695             :   const Operator* CheckedInt32Sub();
     696             :   const Operator* CheckedInt32ToTaggedSigned(const VectorSlotPair& feedback);
     697             :   const Operator* CheckedInt64ToInt32(const VectorSlotPair& feedback);
     698             :   const Operator* CheckedInt64ToTaggedSigned(const VectorSlotPair& feedback);
     699             :   const Operator* CheckedTaggedSignedToInt32(const VectorSlotPair& feedback);
     700             :   const Operator* CheckedTaggedToFloat64(CheckTaggedInputMode,
     701             :                                          const VectorSlotPair& feedback);
     702             :   const Operator* CheckedTaggedToInt32(CheckForMinusZeroMode,
     703             :                                        const VectorSlotPair& feedback);
     704             :   const Operator* CheckedTaggedToInt64(CheckForMinusZeroMode,
     705             :                                        const VectorSlotPair& feedback);
     706             :   const Operator* CheckedTaggedToTaggedPointer(const VectorSlotPair& feedback);
     707             :   const Operator* CheckedTaggedToTaggedSigned(const VectorSlotPair& feedback);
     708             :   const Operator* CheckedTruncateTaggedToWord32(CheckTaggedInputMode,
     709             :                                                 const VectorSlotPair& feedback);
     710             :   const Operator* CheckedUint32Div();
     711             :   const Operator* CheckedUint32Mod();
     712             :   const Operator* CheckedUint32Bounds(const VectorSlotPair& feedback);
     713             :   const Operator* CheckedUint32ToInt32(const VectorSlotPair& feedback);
     714             :   const Operator* CheckedUint32ToTaggedSigned(const VectorSlotPair& feedback);
     715             :   const Operator* CheckedUint64Bounds(const VectorSlotPair& feedback);
     716             :   const Operator* CheckedUint64ToInt32(const VectorSlotPair& feedback);
     717             :   const Operator* CheckedUint64ToTaggedSigned(const VectorSlotPair& feedback);
     718             : 
     719             :   const Operator* ConvertReceiver(ConvertReceiverMode);
     720             : 
     721             :   const Operator* ConvertTaggedHoleToUndefined();
     722             : 
     723             :   const Operator* ObjectIsArrayBufferView();
     724             :   const Operator* ObjectIsBigInt();
     725             :   const Operator* ObjectIsCallable();
     726             :   const Operator* ObjectIsConstructor();
     727             :   const Operator* ObjectIsDetectableCallable();
     728             :   const Operator* ObjectIsMinusZero();
     729             :   const Operator* NumberIsMinusZero();
     730             :   const Operator* ObjectIsNaN();
     731             :   const Operator* NumberIsNaN();
     732             :   const Operator* ObjectIsNonCallable();
     733             :   const Operator* ObjectIsNumber();
     734             :   const Operator* ObjectIsReceiver();
     735             :   const Operator* ObjectIsSmi();
     736             :   const Operator* ObjectIsString();
     737             :   const Operator* ObjectIsSymbol();
     738             :   const Operator* ObjectIsUndetectable();
     739             : 
     740             :   const Operator* NumberIsFloat64Hole();
     741             :   const Operator* NumberIsFinite();
     742             :   const Operator* ObjectIsFiniteNumber();
     743             :   const Operator* NumberIsInteger();
     744             :   const Operator* ObjectIsSafeInteger();
     745             :   const Operator* NumberIsSafeInteger();
     746             :   const Operator* ObjectIsInteger();
     747             : 
     748             :   const Operator* ArgumentsFrame();
     749             :   const Operator* ArgumentsLength(int formal_parameter_count,
     750             :                                   bool is_rest_length);
     751             : 
     752             :   const Operator* NewDoubleElements(PretenureFlag);
     753             :   const Operator* NewSmiOrObjectElements(PretenureFlag);
     754             : 
     755             :   // new-arguments-elements arguments-frame, arguments-length
     756             :   const Operator* NewArgumentsElements(int mapped_count);
     757             : 
     758             :   // new-cons-string length, first, second
     759             :   const Operator* NewConsString();
     760             : 
     761             :   // ensure-writable-fast-elements object, elements
     762             :   const Operator* EnsureWritableFastElements();
     763             : 
     764             :   // maybe-grow-fast-elements object, elements, index, length
     765             :   const Operator* MaybeGrowFastElements(GrowFastElementsMode mode,
     766             :                                         const VectorSlotPair& feedback);
     767             : 
     768             :   // transition-elements-kind object, from-map, to-map
     769             :   const Operator* TransitionElementsKind(ElementsTransition transition);
     770             : 
     771             :   const Operator* Allocate(Type type, PretenureFlag pretenure = NOT_TENURED);
     772             :   const Operator* AllocateRaw(Type type, PretenureFlag pretenure = NOT_TENURED);
     773             : 
     774             :   const Operator* LoadFieldByIndex();
     775             :   const Operator* LoadField(FieldAccess const&);
     776             :   const Operator* StoreField(FieldAccess const&);
     777             : 
     778             :   // load-element [base + index]
     779             :   const Operator* LoadElement(ElementAccess const&);
     780             : 
     781             :   // store-element [base + index], value
     782             :   const Operator* StoreElement(ElementAccess const&);
     783             : 
     784             :   // store-element [base + index], value, only with fast arrays.
     785             :   const Operator* TransitionAndStoreElement(Handle<Map> double_map,
     786             :                                             Handle<Map> fast_map);
     787             :   // store-element [base + index], smi value, only with fast arrays.
     788             :   const Operator* StoreSignedSmallElement();
     789             : 
     790             :   // store-element [base + index], double value, only with fast arrays.
     791             :   const Operator* TransitionAndStoreNumberElement(Handle<Map> double_map);
     792             : 
     793             :   // store-element [base + index], object value, only with fast arrays.
     794             :   const Operator* TransitionAndStoreNonNumberElement(Handle<Map> fast_map,
     795             :                                                      Type value_type);
     796             : 
     797             :   // load-typed-element buffer, [base + external + index]
     798             :   const Operator* LoadTypedElement(ExternalArrayType const&);
     799             : 
     800             :   // load-data-view-element buffer, [base + byte_offset + index]
     801             :   const Operator* LoadDataViewElement(ExternalArrayType const&);
     802             : 
     803             :   // store-typed-element buffer, [base + external + index], value
     804             :   const Operator* StoreTypedElement(ExternalArrayType const&);
     805             : 
     806             :   // store-data-view-element buffer, [base + byte_offset + index], value
     807             :   const Operator* StoreDataViewElement(ExternalArrayType const&);
     808             : 
     809             :   // Abort (for terminating execution on internal error).
     810             :   const Operator* RuntimeAbort(AbortReason reason);
     811             : 
     812             :   const Operator* DateNow();
     813             : 
     814             :  private:
     815             :   Zone* zone() const { return zone_; }
     816             : 
     817             :   const SimplifiedOperatorGlobalCache& cache_;
     818             :   Zone* const zone_;
     819             : 
     820             :   DISALLOW_COPY_AND_ASSIGN(SimplifiedOperatorBuilder);
     821             : };
     822             : 
     823             : }  // namespace compiler
     824             : }  // namespace internal
     825             : }  // namespace v8
     826             : 
     827             : #endif  // V8_COMPILER_SIMPLIFIED_OPERATOR_H_

Generated by: LCOV version 1.10