File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4545(def ^:dynamic *cljs-file* nil )
4646#?(:clj (def ^:dynamic *unchecked-if* false ))
4747(def ^:dynamic *cljs-static-fns* false )
48+ (def ^:dynamic *fn-invoke-direct* false )
4849(def ^:dynamic *cljs-macros-path* " /cljs/core" )
4950(def ^:dynamic *cljs-macros-is-classpath* true )
5051(def ^:dynamic *cljs-dep-set* (with-meta #{} {:dep-path []}))
Original file line number Diff line number Diff line change 166166 :pretty-print :print-input-delimiter :pseudo-names :recompile-dependents :source-map
167167 :source-map-inline :source-map-timestamp :static-fns :target :verbose :warnings
168168 :emit-constants :ups-externs :ups-foreign-libs :ups-libs :warning-handlers :preloads
169- :browser-repl :cache-analysis-format :infer-externs :closure-generate-exports :npm-deps })
169+ :browser-repl :cache-analysis-format :infer-externs :closure-generate-exports :npm-deps
170+ :fn-invoke-direct })
170171
171172(def string->charset
172173 {" iso-8859-1" StandardCharsets/ISO_8859_1
22452246 ; ; we want to warn about NPM dep conflicts before installing the modules
22462247 (check-npm-deps opts)
22472248 (let [compiler-stats (:compiler-stats opts)
2249+ static-fns? (or (and (= (:optimizations opts) :advanced )
2250+ (not (false ? (:static-fns opts))))
2251+ (:static-fns opts)
2252+ ana/*cljs-static-fns*)
22482253 all-opts (-> opts
22492254 maybe-install-node-deps!
22502255 add-implicit-options
22662271 (assoc :sources (-find-sources source all-opts))))
22672272 (binding [comp/*recompiled* (when-not (false ? (:recompile-dependents opts))
22682273 (atom #{}))
2269- ana/*cljs-static-fns*
2270- (or (and (= (:optimizations opts) :advanced )
2271- (not (false ? (:static-fns opts))))
2272- (:static-fns opts)
2273- ana/*cljs-static-fns*)
2274+ ana/*cljs-static-fns* static-fns?
2275+ ana/*fn-invoke-direct* (or (and static-fns?
2276+ (:fn-invoke-direct opts))
2277+ ana/*fn-invoke-direct*)
22742278 *assert* (not= (:elide-asserts opts) true )
22752279 ana/*load-tests* (not= (:load-tests opts) false )
22762280 ana/*cljs-warnings*
Original file line number Diff line number Diff line change 10391039 (if (and ana/*cljs-static-fns* (= (:op f) :var ))
10401040 ; ; higher order case, static information missing
10411041 (let [fprop (str " .cljs$core$IFn$_invoke$arity$" (count args))]
1042- (emits " (" f fprop " ? " f fprop " (" (comma-sep args) " ) : " f " .call(" (comma-sep (cons " null" args)) " ))" ))
1043- (emits f " .call(" (comma-sep (cons " null" args)) " )" ))))))
1042+ (if ana/*fn-invoke-direct*
1043+ (emits " (" f fprop " ? " f fprop " (" (comma-sep args) " ) : "
1044+ f " (" (comma-sep args) " ))" )
1045+ (emits " (" f fprop " ? " f fprop " (" (comma-sep args) " ) : "
1046+ f " .call(" (comma-sep (cons " null" args)) " ))" )))
1047+ (if ana/*fn-invoke-direct*
1048+ (emits f " (" (comma-sep args) " )" )
1049+ (emits f " .call(" (comma-sep (cons " null" args)) " )" )))))))
10441050
10451051(defmethod emit* :new
10461052 [{:keys [ctor args env]}]
You can’t perform that action at this time.
0 commit comments