chromium/v8/src/compiler/simplified-lowering.cc

// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "src/compiler/simplified-lowering.h"

#include <limits>
#include <optional>

#include "include/v8-fast-api-calls.h"
#include "src/base/small-vector.h"
#include "src/codegen/callable.h"
#include "src/codegen/machine-type.h"
#include "src/codegen/tick-counter.h"
#include "src/compiler/access-builder.h"
#include "src/compiler/common-operator.h"
#include "src/compiler/compiler-source-position-table.h"
#include "src/compiler/diamond.h"
#include "src/compiler/graph-visualizer.h"
#include "src/compiler/js-heap-broker.h"
#include "src/compiler/linkage.h"
#include "src/compiler/node-matchers.h"
#include "src/compiler/node-observer.h"
#include "src/compiler/node-origin-table.h"
#include "src/compiler/operation-typer.h"
#include "src/compiler/operator-properties.h"
#include "src/compiler/representation-change.h"
#include "src/compiler/simplified-lowering-verifier.h"
#include "src/compiler/simplified-operator.h"
#include "src/compiler/type-cache.h"
#include "src/numbers/conversions-inl.h"
#include "src/objects/objects.h"

#if V8_ENABLE_WEBASSEMBLY
#include "src/wasm/value-type.h"
#endif  // V8_ENABLE_WEBASSEMBLY

namespace v8 {
namespace internal {
namespace compiler {

// Macro for outputting trace information from representation inference.
#define TRACE

const char* kSimplifiedLoweringReducerName =;

// Representation selection and lowering of {Simplified} operators to machine
// operators are interwined. We use a fixpoint calculation to compute both the
// output representation and the best possible lowering for {Simplified} nodes.
// Representation change insertion ensures that all values are in the correct
// machine representation after this phase, as dictated by the machine
// operators themselves.
enum Phase {};

namespace {

MachineRepresentation MachineRepresentationFromArrayType(
    ExternalArrayType array_type) {}

UseInfo CheckedUseInfoAsWord32FromHint(
    NumberOperationHint hint, IdentifyZeros identify_zeros = kDistinguishZeros,
    const FeedbackSource& feedback = FeedbackSource()) {}

UseInfo CheckedUseInfoAsFloat64FromHint(
    NumberOperationHint hint, const FeedbackSource& feedback,
    IdentifyZeros identify_zeros = kDistinguishZeros) {}

UseInfo TruncatingUseInfoFromRepresentation(MachineRepresentation rep) {}

UseInfo UseInfoForBasePointer(const FieldAccess& access) {}

UseInfo UseInfoForBasePointer(const ElementAccess& access) {}

void ReplaceEffectControlUses(Node* node, Node* effect, Node* control) {}

bool CanOverflowSigned32(const Operator* op, Type left, Type right,
                         TypeCache const* type_cache, Zone* type_zone) {}

bool IsSomePositiveOrderedNumber(Type type) {}

inline bool IsLargeBigInt(Type type) {}

class JSONGraphWriterWithVerifierTypes : public JSONGraphWriter {};

}  // namespace

#ifdef DEBUG
// Helpers for monotonicity checking.
class InputUseInfos {};

#endif  // DEBUG

class RepresentationSelector {};

// Template specializations

// Enqueue {use_node}'s {index} input if the {use_info} contains new information
// for that input node.
template <>
void RepresentationSelector::EnqueueInput<PROPAGATE>(Node* use_node, int index,
                                                     UseInfo use_info) {}

template <>
void RepresentationSelector::SetOutput<PROPAGATE>(
    Node* node, MachineRepresentation representation, Type restriction_type) {}

template <>
void RepresentationSelector::SetOutput<RETYPE>(
    Node* node, MachineRepresentation representation, Type restriction_type) {}

template <>
void RepresentationSelector::SetOutput<LOWER>(
    Node* node, MachineRepresentation representation, Type restriction_type) {}

template <>
void RepresentationSelector::ProcessInput<PROPAGATE>(Node* node, int index,
                                                     UseInfo use) {}

template <>
void RepresentationSelector::ProcessInput<RETYPE>(Node* node, int index,
                                                  UseInfo use) {}

template <>
void RepresentationSelector::ProcessInput<LOWER>(Node* node, int index,
                                                 UseInfo use) {}

template <>
void RepresentationSelector::ProcessRemainingInputs<PROPAGATE>(Node* node,
                                                               int index) {}

// The default, most general visitation case. For {node}, process all value,
// context, frame state, effect, and control inputs, assuming that value
// inputs should have {kRepTagged} representation and can observe all output
// values {kTypeAny}.
template <>
void RepresentationSelector::VisitInputs<PROPAGATE>(Node* node) {}

template <>
void RepresentationSelector::VisitInputs<LOWER>(Node* node) {}

template <>
void RepresentationSelector::InsertUnreachableIfNecessary<LOWER>(Node* node) {}

SimplifiedLowering::SimplifiedLowering(
    JSGraph* jsgraph, JSHeapBroker* broker, Zone* zone,
    SourcePositionTable* source_positions, NodeOriginTable* node_origins,
    TickCounter* tick_counter, Linkage* linkage, OptimizedCompilationInfo* info,
    ObserveNodeManager* observe_node_manager)
    :{}

void SimplifiedLowering::LowerAllNodes() {}

void SimplifiedLowering::DoJSToNumberOrNumericTruncatesToFloat64(
    Node* node, RepresentationSelector* selector) {}

void SimplifiedLowering::DoJSToNumberOrNumericTruncatesToWord32(
    Node* node, RepresentationSelector* selector) {}

Node* SimplifiedLowering::Float64Round(Node* const node) {}

Node* SimplifiedLowering::Float64Sign(Node* const node) {}

Node* SimplifiedLowering::Int32Abs(Node* const node) {}

Node* SimplifiedLowering::Int32Div(Node* const node) {}

Node* SimplifiedLowering::Int32Mod(Node* const node) {}

Node* SimplifiedLowering::Int32Sign(Node* const node) {}

Node* SimplifiedLowering::Uint32Div(Node* const node) {}

Node* SimplifiedLowering::Uint32Mod(Node* const node) {}

void SimplifiedLowering::DoMax(Node* node, Operator const* op,
                               MachineRepresentation rep) {}

void SimplifiedLowering::DoMin(Node* node, Operator const* op,
                               MachineRepresentation rep) {}

void SimplifiedLowering::DoIntegral32ToBit(Node* node) {}

void SimplifiedLowering::DoOrderedNumberToBit(Node* node) {}

void SimplifiedLowering::DoNumberToBit(Node* node) {}

void SimplifiedLowering::DoIntegerToUint8Clamped(Node* node) {}

void SimplifiedLowering::DoNumberToUint8Clamped(Node* node) {}

void SimplifiedLowering::DoSigned32ToUint8Clamped(Node* node) {}

void SimplifiedLowering::DoUnsigned32ToUint8Clamped(Node* node) {}

Node* SimplifiedLowering::ToNumberCode() {}

Node* SimplifiedLowering::ToNumberConvertBigIntCode() {}

Node* SimplifiedLowering::ToNumericCode() {}

Operator const* SimplifiedLowering::ToNumberOperator() {}

Operator const* SimplifiedLowering::ToNumberConvertBigIntOperator() {}

Operator const* SimplifiedLowering::ToNumericOperator() {}

void SimplifiedLowering::ChangeOp(Node* node, const Operator* new_op) {}

#undef TRACE

}  // namespace compiler
}  // namespace internal
}  // namespace v8