#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
namespace v8 {
namespace internal {
namespace compiler {
#define TRACE …
const char* kSimplifiedLoweringReducerName = …;
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 { … };
}
#ifdef DEBUG
class InputUseInfos { … };
#endif
class RepresentationSelector { … };
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) { … }
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
}
}
}