
com.google.javascript.jscomp.PeepholeReplaceKnownMethods.class Maven / Gradle / Ivy
The newest version!
???? 3?
?
g
g
g
g
g
g
g
u
u
!"
#
$
%
&
'
g(
)*
+
,
-
g./0
1 23
u4
56
g7
8
u9
:;
u<
u=
u>
u?
g@
A
BC
uD
5E
BF
G
H
I
uJKL
uM
uN
O
PQR
BS
uT
U
uV
uW
gX
gYZ[
g\]
U
gJ^
X
X_
`
a
X<
Xb
gcde
fgdhi
gj
gkdlm
gn
go
5p
gqrdstutv
gw
x
y
gz
g{|}
v
~d ?
g?
??
?
5??? late Z useTypes (ZZ)V Code LineNumberTable LocalVariableTable this :Lcom/google/javascript/jscomp/PeepholeReplaceKnownMethods; optimizeSubtree F(Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node; subtree "Lcom/google/javascript/rhino/Node;
StackMapTable tryFoldKnownMethods
callTargetm tryFoldKnownStringMethods h(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node;
stringNode functionName isStringLiteral functionNameString Ljava/lang/String; firstArg| tryFoldKnownNumericMethods
firstArgument tryFoldStringToLowerCase lowered replacement tryFoldStringToUpperCase upped normalizeNumericString &(Ljava/lang/String;)Ljava/lang/String; input
startIndex I endIndex tryFoldParseNumber z(Lcom/google/javascript/rhino/Node;Ljava/lang/String;Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node; tmpRadix D numericNode checkVal Ljava/lang/Double; newNode e !Ljava/lang/NumberFormatException; newVal normalizedNewVal n
isParseInt secondArg radix stringVal??R tryFoldStringIndexOf ?(Lcom/google/javascript/rhino/Node;Ljava/lang/String;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node; lstringNode lstring isIndexOf searchValue fromIndex indexVal tryFoldArrayJoin emptyStringNode foldedStringNode node
kJoinOverhead right arrayNode
joinString arrayFoldedChildren Ljava/util/List; sb Ljava/lang/StringBuilder;
foldedSize prev elem originalSize LocalVariableTypeTable 4Ljava/util/List;?^? tryFoldStringSubstr ?(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node; start length maybeLength arg1 stringAsString
maybeStart arg2 result
resultNode parent tryFoldStringSubstringOrSlice end maybeEnd tryReplaceSubstrWithCharAt $tryReplaceSubstringOrSliceWithCharAt replaceWithCharAt tryFoldStringCharAt index tryFoldStringCharCodeAt jsSplitMatch ((Ljava/lang/String;ILjava/lang/String;)I stringValue separator
matchIndex jsSplit :(Ljava/lang/String;Ljava/lang/String;I)[Ljava/lang/String; i limit splitStrings $Ljava/util/List; tryFoldStringSplit element stringArray [Ljava/lang/String; arrayOfStrings
SourceFile PeepholeReplaceKnownMethods.java ?? ? ? ? ??? ? ? ? ?????? ? ??? ? ???????????? split?? ? ??? toLowerCase toUpperCase ? ? ? ??? indexOf lastIndexOf substr substring slice charAt
charCodeAt ? ? ? ? ? ? ? ? ? ?????? ? ? ? ????? parseInt
parseFloat ? ???????????????? ??!????????????????????? ??? 0 0x??????/? java/lang/NumberFormatException???? ? ??????? join ,?? java/util/LinkedList java/lang/StringBuilder????????? ????????? ?????? com/google/javascript/rhino/Node??? ?? ??? [].join()??????????? ? ????? java/lang/String java/util/ArrayList ? ???????? ? ??? 8com/google/javascript/jscomp/PeepholeReplaceKnownMethods 9com/google/javascript/jscomp/AbstractPeepholeOptimization java/lang/Double java/util/List java/util/Iterator ()V isCall ()Z
getFirstChild $()Lcom/google/javascript/rhino/Node; %com/google/javascript/jscomp/NodeUtil isGet %(Lcom/google/javascript/rhino/Node;)Z isName $com/google/common/base/Preconditions
checkArgument (Z)V getLastChild isString getString ()Ljava/lang/String; getNext equals (Ljava/lang/Object;)Z hashCode ()I isImmutableValue getJSType -()Lcom/google/javascript/rhino/jstype/JSType; )com/google/javascript/rhino/jstype/JSType isStringValueType isASTNormalized isNumber java/util/Locale ROOT Ljava/util/Locale; &(Ljava/util/Locale;)Ljava/lang/String; com/google/javascript/rhino/IR string 6(Ljava/lang/String;)Lcom/google/javascript/rhino/Node; replaceWith %(Lcom/google/javascript/rhino/Node;)V reportCodeChange com/google/common/base/Strings
isNullOrEmpty (Ljava/lang/String;)Z (I)C (I)I (II)Ljava/lang/String; getDouble ()D getNumberValue 6(Lcom/google/javascript/rhino/Node;)Ljava/lang/Double; intValue valueOf (I)Ljava/lang/String; number %(D)Lcom/google/javascript/rhino/Node; doubleValue getStringValue 6(Lcom/google/javascript/rhino/Node;)Ljava/lang/String; getStringNumberValue &(Ljava/lang/String;)Ljava/lang/Double; trimJsWhiteSpace isEmpty equalsIgnoreCase isEcmaScript5OrGreater java/lang/Integer (Ljava/lang/String;I)I parseDouble (Ljava/lang/String;)D (D)Ljava/lang/String; isGetProp
isArrayLit removeChild append -(Ljava/lang/String;)Ljava/lang/StringBuilder; getArrayElementStringValue checkNotNull &(Ljava/lang/Object;)Ljava/lang/Object; toString useSourceInfoIfMissingFrom add 0com/google/javascript/jscomp/InlineCostEstimator getCost %(Lcom/google/javascript/rhino/Node;)I size getParent replaceChild G(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)V remove (I)Ljava/lang/Object; detachChildren srcref hasXChildren (I)Z iterator ()Ljava/util/Iterator; hasNext next ()Ljava/lang/Object; addChildToBack 7(Lcom/google/javascript/rhino/Node;Z)Ljava/lang/Double; setString (Ljava/lang/String;)V detach toArray (([Ljava/lang/Object;)[Ljava/lang/Object; isNull java/lang/Math min (II)I arraylit G([Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node; ? ? ? ? ? ? ? ? Y *? *? *? ? ? , - . / ? ? ? ? ? ? ? ? ? ? T +? ? *+? ?+? ? 3 4
6 ? ? ? ? ? ?
? ? ? ? 9*+? L+? ? -+? M,? +?,? ?
*+,? L? ,?
?
*+,? L+? ? *
> @
A B C F G ) H 0 I 7 M ? % ? ? 9 ? ? 9 ? ? ? ? ??
? ? ? ?
?+? ? ,? N,?
:? ? +?-? 6? :,? :??? ? *+-? ?? t:6 ? ? 9 ?1ݖ ?/R? ,? ? 6 ? ? ? 6 ? ' *+-? ?*+-? ??%? ?:6 ? ? ? ??) ???W? c?"V? S?=? ??? ??nQ ss?FI C? ? g6 ? a? ? W6 ? Q? ? G6 ? A? ? 76 ? 1? ? '6 ? !? ? 6 ? ? ? 6 ? [ , , 7 @ @ I R*+-? !?*+-? "?*+-? #?*+-? $?*+-? %?*? ? ?? ?? -? &? ?-? &? '? ?:6 ? ? P ??W? #?=? C?nQ 3? ? &6 ? ? ? 6 ? ? ? 6 ? + " "*+,? (?*+,? )?+? ? r U Y Z \ ] ` " a ) b / c 4 d > e G f L g ? i ? k ? n ? o? r? t? w? y? {? ?? ? ?x ?? ?? ? ? R ? ? ? ? ? ? ? ? ? ? ? ? z ? ? "j ? ? )c ? ? /] ? ? ? J ? ? ?? * ? ?? , ?? ? V ?
-
? !? . ?? ? ? ? ? K+? ? *? *? >,? N,? :? .? ? ? +? -,? ? --? ? *+-? .L+? ? " ? ? ? ? ? 1 ? @ ? I ? ? 4 6 ? ? 0 ? ? K ? ? K ? ? K ? ? ? ? . ? ?? ? ? ? ? ,? ? /? 0N-? 1:+? 2*? 3? ? ? ? ? ? ? ? 4 ? ? ? ? ? ? ? ?
? ? ? ? ? ? ,? ? /? 4N-? 1:+? 2*? 3? ? ? ? ? ? ? ? 4 ? ? ? ? ? ? ? ?
? ?
? ? ? ? n*? 5? *?<*? 6d=*? 6? *? 70? *? 7.? ????*.? 8? $? *? 70? ?????*? 7.? ??? *?*`? 9? ? > ? ? ? ? ? &