com.google.javascript.jscomp.PeepholeFoldConstants.class Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of closure-compiler-unshaded Show documentation
Show all versions of closure-compiler-unshaded Show documentation
Closure Compiler is a JavaScript optimizing compiler. It parses your
JavaScript, analyzes it, removes dead code and rewrites and minimizes
what's left. It also checks syntax, variable references, and types, and
warns about common JavaScript pitfalls. It is used in many of Google's
JavaScript apps, including Gmail, Google Web Search, Google Maps, and
Google Docs.
The newest version!
???? 7?
9com/google/javascript/jscomp/AbstractPeepholeOptimization ()V
2com/google/javascript/jscomp/PeepholeFoldConstants late Z shouldUseTypes 4com/google/javascript/jscomp/PeepholeFoldConstants$1 ,$SwitchMap$com$google$javascript$rhino$Token [I
com/google/javascript/rhino/Node getToken %()Lcom/google/javascript/rhino/Token;
! !com/google/javascript/rhino/Token ordinal ()I
# $ % +tryFoldUselessObjectDotDefinePropertiesCall F(Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node;
' ( % tryFoldCtorCall
* + %
tryFoldTypeof
- . %
tryFoldSpread
0 1 % tryFlattenArrayOrObjectLit
3 4 5 tryReduceOperandsForOp %(Lcom/google/javascript/rhino/Node;)V
7 8 % tryFoldUnaryOperator
: ; %
tryReduceVoid
= > % tryFoldGetProp
@ A % tryFoldBinaryOperator
C D E
getFirstChild $()Lcom/google/javascript/rhino/Node;
G H E getNext
J K L tryFoldGetElem ?(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node;
N O L tryFoldInstanceof
Q R L tryFoldAndOr
T U L tryFoldCoalesce
W X L tryFoldShift
Z [ L
tryFoldAssign
] ^ L tryUnfoldAssignOp
` a L
tryFoldAdd
c d L tryFoldArithmeticOp
f g L tryFoldLeftChildOp
i j L tryFoldComparison
l m n isNumber ()Z
p q r getDouble ()D
t u v mayHaveSideEffects %(Lcom/google/javascript/rhino/Node;)Z
x y z { | com/google/javascript/rhino/IR number %(D)Lcom/google/javascript/rhino/Node;
~ 5 replaceWith
? ? 5 reportChangeToEnclosingScope
? ? E getLastChild
? ? ? ? ? %com/google/javascript/jscomp/NodeUtil mayBeString &(Lcom/google/javascript/rhino/Node;Z)Z
? ? 5 tryConvertOperandsToNumber
? ? 5 tryConvertToNumber
? ? E getSecondChild
? ? ? v isUndefined
? ? ? getSideEffectFreeNumberValue 6(Lcom/google/javascript/rhino/Node;)Ljava/lang/Double;
? ? ? ? r java/lang/Double doubleValue
? ? ? ?
numberNode G(DLcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node;
? ? v isEquivalentTo
? ? n isTypeOf
? ? ? ? ? $com/google/common/base/Preconditions
checkArgument (Z)V
? ? ? ? isLiteralValue ? function ? string { ? boolean ? object ? undefined
? ? ? getString ()Ljava/lang/String;
? ? ? ? ? java/lang/String equals (Ljava/lang/Object;)Z
x ? ? ? 6(Ljava/lang/String;)Lcom/google/javascript/rhino/Node;
? ? 5 markFunctionsDeleted
? ? n hasOneChild
? ? ? ?
checkState (ZLjava/lang/Object;)V
? ? E getParent
? ? ? getSideEffectFreeBooleanValue K(Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/jscomp/base/Tri; ? ? ? ? ? %com/google/javascript/jscomp/base/Tri UNKNOWN 'Lcom/google/javascript/jscomp/base/Tri;
? ? ? ? toBoolean (Z)Z
? ? ? ? booleanNode %(Z)Lcom/google/javascript/rhino/Node;
? ? ? v isNumericResult
? ? E detach
? ? n isName ? NaN
? ? n isNeg
? ? E getOnlyChild
? ? n isBigInt
/com/google/javascript/jscomp/base/JSCompDoubles isMathematicalInteger (D)Z
ecmascriptToInt32 (D)I
FRACTIONAL_BITWISE_OPERAND -Lcom/google/javascript/jscomp/DiagnosticType;
report R(Lcom/google/javascript/jscomp/DiagnosticType;Lcom/google/javascript/rhino/Node;)V
getSideEffectFreeBigIntValue :(Lcom/google/javascript/rhino/Node;)Ljava/math/BigInteger;
bigintNode \(Ljava/math/BigInteger;Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node;
? n
isInfinite
? n isNaN
! n isInstanceOf
?#$ v isImmutableValue
x&' E falseNode) Object
x+, E trueNode
./ n isAssign
12 n hasChildren
456 areNodesEqualForInlining G(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)Z
?89:
isCommutative &(Lcom/google/javascript/rhino/Token;)Z <=>
ASSIGN_ADD #Lcom/google/javascript/rhino/Token; @A>
ASSIGN_BITAND CD> ASSIGN_BITOR FG>
ASSIGN_BITXOR IJ>
ASSIGN_DIV LM>
ASSIGN_LSH OP>
ASSIGN_MOD RS>
ASSIGN_MUL UV>
ASSIGN_RSH XY>
ASSIGN_SUB [\> ASSIGN_URSH ^_> ASSIGN_EXPONENT
a b j(Lcom/google/javascript/rhino/Token;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)V
?def getOpFromAssignmentOp G(Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Token;
hi E cloneTree
kl % srcref
xnop assign h(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node;
?rs ? getBooleanValue uv> OR xy> AND
{| detachChildren
x~p comma ??? ? FALSE ??? ? TRUE
???? getKnownValueType U(Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/jscomp/NodeUtil$ValueType; ?? :$SwitchMap$com$google$javascript$jscomp$NodeUtil$ValueType
? ? /com/google/javascript/jscomp/NodeUtil$ValueType
?? n isAdd
?? n isStringLit
??? v isStringResult
???? getStringValue 6(Lcom/google/javascript/rhino/Node;)Ljava/lang/String; ??? makeConcatWithConstants 8(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
? ?? java/lang/Object
?i ?
??p replace
?? n
isArrayLit
??? getSideEffectFreeStringValue
?? L performArithmeticOp
?? % srcrefTreeIfMissing
? ? v
?? L performBigIntArithmeticOp
?? v isNumeric
??? %maybeReplaceBinaryOpWithNumericResult '(DDD)Lcom/google/javascript/rhino/Node;
x?? % neg
????? java/lang/Math pow (DD)D? java/lang/IllegalStateException ??? 7(Lcom/google/javascript/rhino/Token;)Ljava/lang/String;
?? ? (Ljava/lang/String;)V
????? java/math/BigInteger add .(Ljava/math/BigInteger;)Ljava/math/BigInteger;
???? subtract
???? multiply ???? ZERO Ljava/math/BigInteger;
? ?
???? divide
??? !
intValueExact
???? (I)Ljava/math/BigInteger;? java/lang/ArithmeticException
???? mod
???? and
???? or
???? xor ???? ONE
?? getColor -()Lcom/google/javascript/jscomp/colors/Color; 2com/google/javascript/jscomp/colors/StandardColors NUMBER +Lcom/google/javascript/jscomp/colors/Color;
? v isBigIntResult BIGINT
? valueOf (D)Ljava/lang/String;
? ! length
? abs (D)D MAX_FOLD_NUMBER D
?? ??
?#$:
isAssociative
?& ? ?
() n hasTwoChildren
+, E removeFirstChild
./ L tryFoldAddConstantString
?12 n isEmpty
45 v
isStringTyped
78 L tryFoldAdjacentLiteralLeaves :; STRING
=>? isReasonableDoubleValue (Ljava/lang/Double;)Z@@
?CD ! intValue ????H java/lang/AssertionError ?
GK L (Ljava/lang/Object;)V
NOP evaluateComparison ?(Lcom/google/javascript/jscomp/AbstractPeepholeOptimization;Lcom/google/javascript/rhino/Token;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/jscomp/base/Tri; ?R;S 1Lcom/google/javascript/jscomp/NodeUtil$ValueType;
?
?VWX indexOf (I)I
?Z[\ compareTo (Ljava/lang/String;)I
?^_`
forBoolean *(Z)Lcom/google/javascript/jscomp/base/Tri;
?c[d (Ljava/math/BigInteger;)I
?
ghi bigintLessThanDouble h(Ljava/math/BigInteger;DLcom/google/javascript/jscomp/base/Tri;Z)Lcom/google/javascript/jscomp/base/Tri;
?k?l P(Lcom/google/javascript/jscomp/base/Tri;)Lcom/google/javascript/jscomp/base/Tri;
no isAtLeastIntegerPrecision
?qr (J)Ljava/math/BigInteger;
tu isExactInt64
wx
isPositive ?z{S UNDETERMINED
}~ tryStrictEqualityComparison ?(Lcom/google/javascript/jscomp/AbstractPeepholeOptimization;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/jscomp/base/Tri; ???S NULL ???S VOID ??S ???S BOOLEAN
?? tryAbstractEqualityComparison ??S ???S OBJECT
?? v
?
???l
???? not )()Lcom/google/javascript/jscomp/base/Tri;
???l
t
??? tryAbstractRelationalComparison ?(Lcom/google/javascript/jscomp/AbstractPeepholeOptimization;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;Z)Lcom/google/javascript/jscomp/base/Tri;? "Unexpected operator for comparison
?? n isNew
?? v inForcedStringContext
?? % tryFoldInForcedStringContext
?? n isCall
?? n isOptChainCall
??? v "isObjectDefinePropertiesDefinition
?? n isObjectLit
?? n isGetElem? String?
?? % srcrefIfMissing
?? n isOptChainGetElem
??? tryFoldObjectPropAccess z(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;Ljava/lang/String;)Lcom/google/javascript/rhino/Node;
?? L tryFoldArrayAccess
?? L tryFoldStringArrayAccess
?? n isGetProp
?? n isOptChainGetProp
?? !
getChildCount
??? v isLValue
?? isExactInt32 ?? INVALID_GETELEM_INDEX_ERROR
?? n isSpread
??? % newUndefinedNode
1
?? E removeChildren
??? addChildrenAfter G(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)V
?
???? charAt (I)C
????? java/lang/Character toString (C)Ljava/lang/String;
??? v isNormalOrOptChainGet
? v isOptChainNode
?
? v referencesSuper
x E nullNode
? v
isGetOrSetKey
? v isInvocationTarget
n
isFunction
? v referencesOwnReceiver
? % getEndOfOptChainSegment
? 5 convertToNonOptionalChainSegment
x call i(Lcom/google/javascript/rhino/Node;[Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node; !"# FREE_CALL 'Lcom/google/javascript/rhino/Node$Prop;
%&' putBooleanProp +(Lcom/google/javascript/rhino/Node$Prop;Z)V
?)* ! signum
?,-. negate ()Ljava/math/BigInteger;
x012 bigint :(Ljava/math/BigInteger;)Lcom/google/javascript/rhino/Node;
45 %
srcrefTree7 JSC_INVALID_GETELEM_INDEX_ERROR9 Array index not integer: {0}
;<=>? +com/google/javascript/jscomp/DiagnosticType warning S(Ljava/lang/String;Ljava/lang/String;)Lcom/google/javascript/jscomp/DiagnosticType;A JSC_FRACTIONAL_BITWISE_OPERANDC Fractional bitwise operand: {0}@ @J? (ZZ)V Code LineNumberTable LocalVariableTable this 4Lcom/google/javascript/jscomp/PeepholeFoldConstants; MethodParameters optimizeSubtree subtree "Lcom/google/javascript/rhino/Node;
StackMapTable result left right n child next c Ljava/lang/Double; value replacement newNode originalTypeofNode argumentNode typeNameString Ljava/lang/String; numValue replacementNode leftLeft intVal I
notIntValNode
bigintNotNode doubleVal bigintVal parent leftVal x RuntimeVisibleTypeAnnotations #Lorg/jspecify/annotations/Nullable; newRight newType op lval
rightValue dropped type rightGrandparent rr foldIsTypeSafe
leftParent rightParent
newStringNode
leftString rightString lValObj rValObj rval exception Ljava/lang/ArithmeticException; lVal rVal ll lr valueToCombine opType rightValObj rightBigInt node oldNode rightVal rvalInt bits newNumber lvStr rvStr peepholeOptimization ;Lcom/google/javascript/jscomp/AbstractPeepholeOptimization;
willNegate
leftValueType rightValueType lvBig rvBig lvNum rvNum invert numberAsBigInt negativeMeansBigintSmaller rv lv destObj srcObj stringValue newString
objectType knownLength
lengthNode name i index intIndex current elem spread innerLit parentLit C prop endOfCurrentChain key tempValue hasSideEffectBesidesValue keyIsGetter
nIsInvoked val tree
SourceFile PeepholeFoldConstants.java NestMembers BootstrapMethods?
????? $java/lang/invoke/StringConcatFactory ?(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;? ? !Unexpected arithmetic operator: ? Unknown shift operator: InnerClasses ValueType? %com/google/javascript/rhino/Node$Prop Prop? %java/lang/invoke/MethodHandles$Lookup? java/lang/invoke/MethodHandles Lookup ? / H I Y *? *? *?
? J B C D EK LM N O % I ?? +? ? .? z E E K Q W ] ] c c c c n t t*+? "?*+? &?*+? )?*+? ,?*+? /?*+? 2*+? 6?*+? 9?*+? *+? 2*+? ?? J 2 I P L V O \ R b U h Y n _ s ` y c g ? j ? kK ?LM ?PQ R
? P
N P A % I 8+? BM,? +?,? FN-? +?? +? ? .? 5 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
*+,-? I?*+,-? M?*+,-? P?*+,-? S?*+,-? V?*+,-? Y?*+,-? \?*+,-? _?*+,-? b?*+,-? b:+? ?*+,-? e?*+,-? h?+? J Z p r s v x y } ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?# ?&