Index: src/compiler/effect-control-linearizer.h |
diff --git a/src/compiler/effect-control-linearizer.h b/src/compiler/effect-control-linearizer.h |
index dc48cd9cfac5e302c528d9fbaaf84a05af1b8f13..9d991cfb4bee079be429e182a865aca81244a4b4 100644 |
--- a/src/compiler/effect-control-linearizer.h |
+++ b/src/compiler/effect-control-linearizer.h |
@@ -6,6 +6,7 @@ |
#define V8_COMPILER_EFFECT_CONTROL_LINEARIZER_H_ |
#include "src/compiler/common-operator.h" |
+#include "src/compiler/graph-assembler.h" |
#include "src/compiler/node.h" |
#include "src/compiler/simplified-operator.h" |
#include "src/globals.h" |
@@ -38,181 +39,90 @@ class V8_EXPORT_PRIVATE EffectControlLinearizer { |
void ProcessNode(Node* node, Node** frame_state, Node** effect, |
Node** control); |
- struct ValueEffectControl { |
- Node* value; |
- Node* effect; |
- Node* control; |
- ValueEffectControl(Node* value, Node* effect, Node* control) |
- : value(value), effect(effect), control(control) {} |
- }; |
- |
bool TryWireInStateEffect(Node* node, Node* frame_state, Node** effect, |
Node** control); |
- ValueEffectControl LowerChangeBitToTagged(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerChangeInt31ToTaggedSigned(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerChangeInt32ToTagged(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerChangeUint32ToTagged(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerChangeFloat64ToTagged(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerChangeFloat64ToTaggedPointer(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerChangeTaggedSignedToInt32(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerChangeTaggedToBit(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerChangeTaggedToInt32(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerChangeTaggedToUint32(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerCheckBounds(Node* node, Node* frame_state, |
- Node* effect, Node* control); |
- ValueEffectControl LowerCheckMaps(Node* node, Node* frame_state, Node* effect, |
- Node* control); |
- ValueEffectControl LowerCheckNumber(Node* node, Node* frame_state, |
- Node* effect, Node* control); |
- ValueEffectControl LowerCheckString(Node* node, Node* frame_state, |
- Node* effect, Node* control); |
- ValueEffectControl LowerCheckInternalizedString(Node* node, Node* frame_state, |
- Node* effect, Node* control); |
- ValueEffectControl LowerCheckIf(Node* node, Node* frame_state, Node* effect, |
- Node* control); |
- ValueEffectControl LowerCheckedInt32Add(Node* node, Node* frame_state, |
- Node* effect, Node* control); |
- ValueEffectControl LowerCheckedInt32Sub(Node* node, Node* frame_state, |
- Node* effect, Node* control); |
- ValueEffectControl LowerCheckedInt32Div(Node* node, Node* frame_state, |
- Node* effect, Node* control); |
- ValueEffectControl LowerCheckedInt32Mod(Node* node, Node* frame_state, |
- Node* effect, Node* control); |
- ValueEffectControl LowerCheckedUint32Div(Node* node, Node* frame_state, |
- Node* effect, Node* control); |
- ValueEffectControl LowerCheckedUint32Mod(Node* node, Node* frame_state, |
- Node* effect, Node* control); |
- ValueEffectControl LowerCheckedInt32Mul(Node* node, Node* frame_state, |
- Node* effect, Node* control); |
- ValueEffectControl LowerCheckedInt32ToTaggedSigned(Node* node, |
- Node* frame_state, |
- Node* effect, |
- Node* control); |
- ValueEffectControl LowerCheckedUint32ToInt32(Node* node, Node* frame_state, |
- Node* effect, Node* control); |
- ValueEffectControl LowerCheckedUint32ToTaggedSigned(Node* node, |
- Node* frame_state, |
- Node* effect, |
- Node* control); |
- ValueEffectControl LowerCheckedFloat64ToInt32(Node* node, Node* frame_state, |
- Node* effect, Node* control); |
- ValueEffectControl LowerCheckedTaggedSignedToInt32(Node* node, |
- Node* frame_state, |
- Node* effect, |
- Node* control); |
- ValueEffectControl LowerCheckedTaggedToInt32(Node* node, Node* frame_state, |
- Node* effect, Node* control); |
- ValueEffectControl LowerCheckedTaggedToFloat64(Node* node, Node* frame_state, |
- Node* effect, Node* control); |
- ValueEffectControl LowerCheckedTaggedToTaggedSigned(Node* node, |
- Node* frame_state, |
- Node* effect, |
- Node* control); |
- ValueEffectControl LowerCheckedTaggedToTaggedPointer(Node* node, |
- Node* frame_state, |
- Node* effect, |
- Node* control); |
- ValueEffectControl LowerChangeTaggedToFloat64(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerTruncateTaggedToBit(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerTruncateTaggedToFloat64(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerTruncateTaggedToWord32(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerCheckedTruncateTaggedToWord32(Node* node, |
- Node* frame_state, |
- Node* effect, |
- Node* control); |
- ValueEffectControl LowerObjectIsCallable(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerObjectIsNumber(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerObjectIsReceiver(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerObjectIsSmi(Node* node, Node* effect, Node* control); |
- ValueEffectControl LowerObjectIsString(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerObjectIsUndetectable(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerNewRestParameterElements(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerNewUnmappedArgumentsElements(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerArrayBufferWasNeutered(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerStringCharAt(Node* node, Node* effect, Node* control); |
- ValueEffectControl LowerStringCharCodeAt(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerStringFromCharCode(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerStringFromCodePoint(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerStringEqual(Node* node, Node* effect, Node* control); |
- ValueEffectControl LowerStringLessThan(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerStringLessThanOrEqual(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerCheckFloat64Hole(Node* node, Node* frame_state, |
- Node* effect, Node* control); |
- ValueEffectControl LowerCheckTaggedHole(Node* node, Node* frame_state, |
- Node* effect, Node* control); |
- ValueEffectControl LowerConvertTaggedHoleToUndefined(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerPlainPrimitiveToNumber(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerPlainPrimitiveToWord32(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerPlainPrimitiveToFloat64(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerEnsureWritableFastElements(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerMaybeGrowFastElements(Node* node, Node* frame_state, |
- Node* effect, Node* control); |
- ValueEffectControl LowerTransitionElementsKind(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerLoadTypedElement(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerStoreTypedElement(Node* node, Node* effect, |
- Node* control); |
+ Node* LowerChangeBitToTagged(Node* node); |
+ Node* LowerChangeInt31ToTaggedSigned(Node* node); |
+ Node* LowerChangeInt32ToTagged(Node* node); |
+ Node* LowerChangeUint32ToTagged(Node* node); |
+ Node* LowerChangeFloat64ToTagged(Node* node); |
+ Node* LowerChangeFloat64ToTaggedPointer(Node* node); |
+ Node* LowerChangeTaggedSignedToInt32(Node* node); |
+ Node* LowerChangeTaggedToBit(Node* node); |
+ Node* LowerChangeTaggedToInt32(Node* node); |
+ Node* LowerChangeTaggedToUint32(Node* node); |
+ Node* LowerCheckBounds(Node* node, Node* frame_state); |
+ Node* LowerCheckInternalizedString(Node* node, Node* frame_state); |
+ Node* LowerCheckMaps(Node* node, Node* frame_state); |
+ Node* LowerCheckNumber(Node* node, Node* frame_state); |
+ Node* LowerCheckString(Node* node, Node* frame_state); |
+ Node* LowerCheckIf(Node* node, Node* frame_state); |
+ Node* LowerCheckedInt32Add(Node* node, Node* frame_state); |
+ Node* LowerCheckedInt32Sub(Node* node, Node* frame_state); |
+ Node* LowerCheckedInt32Div(Node* node, Node* frame_state); |
+ Node* LowerCheckedInt32Mod(Node* node, Node* frame_state); |
+ Node* LowerCheckedUint32Div(Node* node, Node* frame_state); |
+ Node* LowerCheckedUint32Mod(Node* node, Node* frame_state); |
+ Node* LowerCheckedInt32Mul(Node* node, Node* frame_state); |
+ Node* LowerCheckedInt32ToTaggedSigned(Node* node, Node* frame_state); |
+ Node* LowerCheckedUint32ToInt32(Node* node, Node* frame_state); |
+ Node* LowerCheckedUint32ToTaggedSigned(Node* node, Node* frame_state); |
+ Node* LowerCheckedFloat64ToInt32(Node* node, Node* frame_state); |
+ Node* LowerCheckedTaggedSignedToInt32(Node* node, Node* frame_state); |
+ Node* LowerCheckedTaggedToInt32(Node* node, Node* frame_state); |
+ Node* LowerCheckedTaggedToFloat64(Node* node, Node* frame_state); |
+ Node* LowerCheckedTaggedToTaggedSigned(Node* node, Node* frame_state); |
+ Node* LowerCheckedTaggedToTaggedPointer(Node* node, Node* frame_state); |
+ Node* LowerChangeTaggedToFloat64(Node* node); |
+ Node* LowerTruncateTaggedToBit(Node* node); |
+ Node* LowerTruncateTaggedToFloat64(Node* node); |
+ Node* LowerTruncateTaggedToWord32(Node* node); |
+ Node* LowerCheckedTruncateTaggedToWord32(Node* node, Node* frame_state); |
+ Node* LowerObjectIsCallable(Node* node); |
+ Node* LowerObjectIsNumber(Node* node); |
+ Node* LowerObjectIsReceiver(Node* node); |
+ Node* LowerObjectIsSmi(Node* node); |
+ Node* LowerObjectIsString(Node* node); |
+ Node* LowerObjectIsUndetectable(Node* node); |
+ Node* LowerNewRestParameterElements(Node* node); |
+ Node* LowerNewUnmappedArgumentsElements(Node* node); |
+ Node* LowerArrayBufferWasNeutered(Node* node); |
+ Node* LowerStringCharAt(Node* node); |
+ Node* LowerStringCharCodeAt(Node* node); |
+ Node* LowerStringFromCharCode(Node* node); |
+ Node* LowerStringFromCodePoint(Node* node); |
+ Node* LowerStringEqual(Node* node); |
+ Node* LowerStringLessThan(Node* node); |
+ Node* LowerStringLessThanOrEqual(Node* node); |
+ Node* LowerCheckFloat64Hole(Node* node, Node* frame_state); |
+ Node* LowerCheckTaggedHole(Node* node, Node* frame_state); |
+ Node* LowerConvertTaggedHoleToUndefined(Node* node); |
+ Node* LowerPlainPrimitiveToNumber(Node* node); |
+ Node* LowerPlainPrimitiveToWord32(Node* node); |
+ Node* LowerPlainPrimitiveToFloat64(Node* node); |
+ Node* LowerEnsureWritableFastElements(Node* node); |
+ Node* LowerMaybeGrowFastElements(Node* node, Node* frame_state); |
+ void LowerTransitionElementsKind(Node* node); |
+ Node* LowerLoadTypedElement(Node* node); |
+ void LowerStoreTypedElement(Node* node); |
// Lowering of optional operators. |
- ValueEffectControl LowerFloat64RoundUp(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerFloat64RoundDown(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerFloat64RoundTiesEven(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl LowerFloat64RoundTruncate(Node* node, Node* effect, |
- Node* control); |
- |
- ValueEffectControl AllocateHeapNumberWithValue(Node* node, Node* effect, |
- Node* control); |
- ValueEffectControl BuildCheckedFloat64ToInt32(CheckForMinusZeroMode mode, |
- Node* value, Node* frame_state, |
- Node* effect, Node* control); |
- ValueEffectControl BuildCheckedHeapNumberOrOddballToFloat64( |
- CheckTaggedInputMode mode, Node* value, Node* frame_state, Node* effect, |
- Node* control); |
- ValueEffectControl BuildFloat64RoundDown(Node* value, Node* effect, |
- Node* control); |
- ValueEffectControl LowerStringComparison(Callable const& callable, Node* node, |
- Node* effect, Node* control); |
+ Maybe<Node*> LowerFloat64RoundUp(Node* node); |
+ Maybe<Node*> LowerFloat64RoundDown(Node* node); |
+ Maybe<Node*> LowerFloat64RoundTiesEven(Node* node); |
+ Maybe<Node*> LowerFloat64RoundTruncate(Node* node); |
+ |
+ Node* AllocateHeapNumberWithValue(Node* node); |
+ Node* BuildCheckedFloat64ToInt32(CheckForMinusZeroMode mode, Node* value, |
+ Node* frame_state); |
+ Node* BuildCheckedHeapNumberOrOddballToFloat64(CheckTaggedInputMode mode, |
+ Node* value, |
+ Node* frame_state); |
+ Node* BuildFloat64RoundDown(Node* value); |
+ Node* LowerStringComparison(Callable const& callable, Node* node); |
Node* ChangeInt32ToSmi(Node* value); |
Node* ChangeUint32ToSmi(Node* value); |
- Node* ChangeInt32ToFloat64(Node* value); |
- Node* ChangeUint32ToFloat64(Node* value); |
Node* ChangeSmiToInt32(Node* value); |
Node* ObjectIsSmi(Node* value); |
@@ -229,15 +139,14 @@ class V8_EXPORT_PRIVATE EffectControlLinearizer { |
SimplifiedOperatorBuilder* simplified() const; |
MachineOperatorBuilder* machine() const; |
- Operator const* ToNumberOperator(); |
+ GraphAssembler* gasm() { return &graph_assembler_; } |
JSGraph* js_graph_; |
Schedule* schedule_; |
Zone* temp_zone_; |
RegionObservability region_observability_ = RegionObservability::kObservable; |
SourcePositionTable* source_positions_; |
- |
- SetOncePointer<Operator const> to_number_operator_; |
+ GraphAssembler graph_assembler_; |
}; |
} // namespace compiler |