git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge pull request #1147 from purescript/no-fromNumber-optimize

Don't inline fromNumber

commit89121bb61541f977069c7b90c53a0976bd9f9037 authorPhil Freeman <paf31@cantab.net> dateSun 7 Jun 2015, 12:55 (11 years ago) parent58acfaef08bedf
2 files changed−5
src/Language/PureScript/CodeGen/JS/Optimizer/Inliner.hs−2 src/Language/PureScript/Constants.hs−3
src/Language/PureScript/CodeGen/JS/Optimizer/Inliner.hs−2
@@ -97,7 +97,6 @@ inlineValues = everywhereOnJS convert
9797 | isDict semiringInt dict && isFn fnOne fn = JSNumericLiteral (Left 1)
9898 | isDict boundedBoolean dict && isFn fnBottom fn = JSBooleanLiteral False
9999 | isDict boundedBoolean dict && isFn fnTop fn = JSBooleanLiteral True
100− convert (JSApp fn [value]) | isFn fromNumber fn = JSBinary BitwiseOr value (JSNumericLiteral (Left 0))
101100 convert (JSApp (JSApp (JSApp fn [dict]) [x]) [y])
102101 | isDict semiringInt dict && isFn fnAdd fn = JSBinary BitwiseOr (JSBinary Add x y) (JSNumericLiteral (Left 0))
103102 | isDict semiringInt dict && isFn fnMultiply fn = JSBinary BitwiseOr (JSBinary Multiply x y) (JSNumericLiteral (Left 0))
@@ -108,7 +107,6 @@ inlineValues = everywhereOnJS convert
108107 fnOne = (C.prelude, C.one)
109108 fnBottom = (C.prelude, C.bottom)
110109 fnTop = (C.prelude, C.top)
111− fromNumber = (C.dataInt, C.fromNumber)
112110 fnAdd = (C.prelude, (C.+))
113111 fnDivide = (C.prelude, (C./))
114112 fnMultiply = (C.prelude, (C.*))
src/Language/PureScript/Constants.hs−3
@@ -115,9 +115,6 @@ zshr = "zshr"
115115complement :: String
116116complement = "complement"
117117
118−fromNumber :: String
119−fromNumber = "fromNumber"
120−
121118-- Prelude Values
122119
123120zero :: String