aboutsummaryrefslogtreecommitdiff
path: root/expr.go
Commit message (Collapse)AuthorAgeFilesLines
* use github.com/golang/glogFumitoshi Ukai2015-07-101-1/+3
|
* use sync.Pool for evalBuffer and wordBufferFumitoshi Ukai2015-07-091-6/+6
|
* fix unmatched_paren2.mkFumitoshi Ukai2015-07-081-1/+14
|
* fix equal_in_target.mkFumitoshi Ukai2015-07-071-0/+3
|
* fix err_unterminated_var.mkFumitoshi Ukai2015-07-071-0/+5
|
* fix err_unterminated_func.mkFumitoshi Ukai2015-07-071-1/+6
|
* introduce evalWriterFumitoshi Ukai2015-07-071-31/+15
| | | | merge ssvWriter into buffer
* refactor parserFumitoshi Ukai2015-07-071-0/+6
| | | | fix backslash_in_rule_command.mk
* fix unmatched_paren.mkFumitoshi Ukai2015-07-031-19/+34
|
* fix TODO in value.mkFumitoshi Ukai2015-06-301-6/+22
|
* fix panic based error reportingFumitoshi Ukai2015-06-261-48/+88
|
* unexport Func and ExprFumitoshi Ukai2015-06-251-45/+41
|
* unexport serialize/deserializeFumitoshi Ukai2015-06-251-35/+35
|
* fix TestParaFumitoshi Ukai2015-06-251-6/+6
| | | | unexport ValueType*
* go gettable for github.com/google/katiFumitoshi Ukai2015-06-251-2/+2
|
* add -shell-date flag to specify time for $(shell date)Fumitoshi Ukai2015-06-241-0/+27
| | | | | --shell-date=ref uses go reference time. useful to check parsed data with golden data.
* add param.mkFumitoshi Ukai2015-06-191-2/+2
| | | | no need to assign/restore call parameter
* remove convT2I from appendStrFumitoshi Ukai2015-06-181-1/+1
|
* reduce runtime.convT2I -> runtime.newobject -> runtime.mallocgcFumitoshi Ukai2015-06-181-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | conversion from value to interface is more expensive than conversion from pointer to interface. package main import "testing" type I interface { String() string } type val struct { s string } func (v val) String() string { return v.s } type ptr struct { s string } func (p *ptr) String() string { return p.s } func BenchmarkT2IForValue(b *testing.B) { var intf I for i := 0; i < b.N; i++ { intf = val{"abc"} } _ = intf } func BenchmarkT2IForPtr(b *testing.B) { var intf I for i := 0; i < b.N; i++ { intf = &ptr{"abc"} } _ = intf } % go test -bench . a_test.go testing: warning: no tests to run PASS BenchmarkT2IForValue 20000000 90.9 ns/op BenchmarkT2IForPtr 20000000 76.8 ns/op ok command-line-arguments 3.539s
* parseExpr less allocationFumitoshi Ukai2015-06-181-39/+74
|
* add findleaves supportFumitoshi Ukai2015-06-151-4/+4
|
* trace event: also emit findcache init eventFumitoshi Ukai2015-06-151-5/+10
|
* refactor sh builtinsFumitoshi Ukai2015-06-111-0/+29
| | | | | add -use_shell_builtins flag to disable the feature (when some builtin is broken)
* add -kati_trace_event=<json filename>Fumitoshi Ukai2015-06-111-10/+9
| | | | | if this option is given, it outputs trace json file for chrome://tracing for makefile include traces.
* Add LICENSE and licence headersShinichiro Hamaji2015-06-101-0/+14
|
* fix -kati_eval_stats to dump stats for func callFumitoshi Ukai2015-06-081-1/+1
|
* fix go lint (except comment on exported fields, error message with punct)Fumitoshi Ukai2015-06-081-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ast.go:70:1: comment on exported type MaybeRuleAST should be of the form "MaybeRuleAST ..." (with optional leading article) eval.go:241:1: comment on exported method Evaluator.EvaluateVar should be of the form "EvaluateVar ..." eval.go:14:2: don't use ALL_CAPS in Go names; use CamelCase eval.go:15:2: don't use ALL_CAPS in Go names; use CamelCase eval.go:16:2: don't use ALL_CAPS in Go names; use CamelCase eval.go:431:2: don't use underscores in Go names; var makefile_list should be makefileList main.go:29:2: var loadJson should be loadJSON main.go:30:2: var saveJson should be saveJSON ninja.go:19:2: struct field ruleId should be ruleID para.go:15:9: if block ends with a return statement, so drop this else and outdent its block para_test.go:21:2: don't use underscores in Go names; var num_tasks should be numTasks parser.go:713:1: error should be the last type when returning multiple items serialize.go:20:2: don't use ALL_CAPS in Go names; use CamelCase serialize.go:21:2: don't use ALL_CAPS in Go names; use CamelCase serialize.go:22:2: don't use ALL_CAPS in Go names; use CamelCase serialize.go:23:2: don't use ALL_CAPS in Go names; use CamelCase serialize.go:24:2: don't use ALL_CAPS in Go names; use CamelCase serialize.go:25:2: don't use ALL_CAPS in Go names; use CamelCase serialize.go:26:2: don't use ALL_CAPS in Go names; use CamelCase serialize.go:27:2: don't use ALL_CAPS in Go names; use CamelCase serialize.go:28:2: don't use ALL_CAPS in Go names; use CamelCase serialize.go:29:2: don't use ALL_CAPS in Go names; use CamelCase serialize.go:30:2: don't use ALL_CAPS in Go names; use CamelCase serialize.go:31:2: don't use ALL_CAPS in Go names; use CamelCase serialize.go:32:2: don't use ALL_CAPS in Go names; use CamelCase serialize.go:230:6: func DumpDepGraphAsJson should be DumpDepGraphAsJSON serialize.go:553:6: func LoadDepGraphFromJson should be LoadDepGraphFromJSON serialize.go:437:9: if block ends with a return statement, so drop this else and outdent its block var.go:174:1: receiver name should not be an underscore var.go:175:1: receiver name should not be an underscore var.go:176:1: receiver name should not be an underscore var.go:177:1: receiver name should not be an underscore var.go:178:1: receiver name should not be an underscore var.go:180:1: receiver name should not be an underscore var.go:183:1: receiver name should not be an underscore var.go:187:1: receiver name should not be an underscore var.go:191:1: receiver name should not be an underscore
* Do not use gob to create unqiue ID for each varsShinichiro Hamaji2015-05-151-4/+36
| | | | Now serialization is 5 times faster (41 secs => 8 secs).
* define buffer to hold args in addition to bytes.BufferFumitoshi Ukai2015-05-081-4/+10
|
* don't reuse too large bufferFumitoshi Ukai2015-05-081-0/+3
| | | | | too large buffer may cause pressure on memory/gc, so reuse buffer that cap < 1024 (as fmt pacakge does)
* use sync.Pool for temporal bytes.Buffer.Fumitoshi Ukai2015-05-071-8/+30
| | | | | | | | | | | | remove ev.Value and ev.Values before: scanblock: 8.22s (14.83%) runtime.MScan_Sweep 4.99s(9.00%) after: scanblock: 7.42s (12.95%) runtime.MScan_Sweep 4.57s(7.98%)
* Re-format codeShinichiro Hamaji2015-04-281-1/+1
|
* Make it possible to serialize varsShinichiro Hamaji2015-04-281-0/+37
|
* minor performance tuningFumitoshi Ukai2015-04-191-15/+14
| | | | use []byte instead of bytes.Buffer to reduce heap allocation.
* add paramref for fast path for param access (e.g. $1, $(1))Fumitoshi Ukai2015-04-191-1/+32
| | | | | | | | | | | | | | | | still set "1" in Vars, for access like n := 1 v := $($(n)) fix to set $0 to variable name in $(call ) after: % ./run_integration_test.rb android Running make for android... 5.62 secs Running kati for android... 10.89 secs android: OK PASS!
* minor performance tuningFumitoshi Ukai2015-04-181-1/+1
| | | | | | | | | | | | | | | | | | | | don't call unnecessary bytes.IndexByte before: ukai@ubune.tok ~/src/kati% ./run_integration_test.rb android Running make for android... 5.78 secs Running kati for android... 13.44 secs android: OK PASS! after: % ./run_integration_test.rb android Running make for android... 5.75 secs Running kati for android... 10.97 secs android: OK PASS!
* use io.WriteString instead of fmt.FprintFumitoshi Ukai2015-04-181-3/+3
| | | | remove unnecessary []byte string conversion in funcShell.
* minor performance tuningFumitoshi Ukai2015-04-181-2/+12
| | | | | | | | | | | | | | | | | | before: % ./run_integration_test.rb android Running make for android... 5.76 secs Running kati for android... 17.29 secs android: OK PASS! after: % ./run_integration_test.rb android Running make for android... 5.83 secs Running kati for android... 14.55 secs android: OK PASS!
* Compactor returns Value, not FuncFumitoshi Ukai2015-04-161-6/+8
|
* introduce func compactor.Fumitoshi Ukai2015-04-161-1/+8
| | | | $(eval ## comment) will be nop when parsed.
* remove trimSpace and inFunc from parseExpr.Fumitoshi Ukai2015-04-161-31/+80
| | | | handled these in parseFunc.
* change f.closure.args[0] has "(funcname", or "{funcname".Fumitoshi Ukai2015-04-161-2/+2
| | | | | | | remove f.closure.expr fclosure.String would not be called so often now (except debug logging?), and keeping expr would require lots of memory.
* dump stats for eval time.Fumitoshi Ukai2015-04-151-0/+24
| | | | | | | | | | | | | | | | | | | | for android dump-products $ cd repo/android $ ../../kati -kati_stats dump-products .. build/core/product_config.mk:235: *** done. func:$(foreach _in,$(2), $(if $(wildcard $(_in)), $(if $($(1).$(_in).seen), $(eval ### "skipping already-imported $(_in)") , $(eval $(1).$(_in).seen := true) $(call _import-node,$(1),$(strip $(_in)),$(3)) ) , $(error $(1): "$(_in)" does not exist) ) ),1556,695.16116ms,1m59.356291639s func:$(if $(wildcard $(_in)), $(if $($(1).$(_in).seen), $(eval ### "skipping already-imported $(_in)") , $(eval $(1).$(_in).seen := true) $(call _import-node,$(1),$(strip $(_in)),$(3)) ) , $(error $(1): "$(_in)" does not exist) ),1492,695.141538ms,1m59.31431654s func:$(if $($(1).$(_in).seen), $(eval ### "skipping already-imported $(_in)") , $(eval $(1).$(_in).seen := true) $(call _import-node,$(1),$(strip $(_in)),$(3))),1492,695.103627ms,1m59.274735972s func:$(call _import-node,$(1),$(strip $(_in)),$(3)),1492,695.059475ms,1m59.211652155s func:$(call _import-nodes-inner,$(1),$($(1).$(2).inherited),$(3)),1492,665.538963ms,1m34.44328975s func:$(call import-products, $(all_product_makefiles)),1,25.242518851s,25.242518851s func:$(call import-nodes,PRODUCTS,$(1),$(_product_var_list)),1,25.242508858s,25.242508858s func:$(if $(foreach _in,$(2), $(eval _node_import_context := _nic.$(1).[[$(_in)]]) $(if $(_include_stack),$(eval $(error ASSERTION FAILED: _include_stack shouldbe empty here: $(_include_stack))),) $(eval _include_stack := ) $(call _import-nodes-inner,$(_node_import_context),$(_in),$(3)) $(call move-var-list,$(_node_import_context).$(_in),$(1).$(_in),$(3)) $(eval _node_import_context :=) $(eval $(1) := $($(1)) $(_in)) $(if $(_include_stack),$(eval $(error ASSERTION FAILED: _include_stack should be empty here: $(_include_stack))),) ) ,),1,25.242492045s,25.242492045s func:$(foreach _in,$(2), $(eval _node_import_context := _nic.$(1).[[$(_in)]]) $(if $(_include_stack),$(eval $(error ASSERTION FAILED: _include_stack should be empty here: $(_include_stack))),) $(eval _include_stack := ) $(call _import-nodes-inner,$(_node_import_context),$(_in),$(3)) $(call move-var-list,$(_node_import_context).$(_in),$(1).$(_in),$(3)) $(eval _node_import_context :=) $(eval $(1) := $($(1)) $(_in)) $(if $(_include_stack),$(eval $(error ASSERTION FAILED: _include_stack should be empty here: $(_include_stack))),) ),1,25.242488741s,25.242488741s func:$(call _import-nodes-inner,$(_node_import_context),$(_in),$(3)),64,695.186876ms,24.959185237s ..
* Fix calls in multiple linesShinichiro Hamaji2015-04-131-3/+20
|
* Remove the use of evalExpr from condition functionsShinichiro Hamaji2015-04-111-5/+20
|
* rewrite call and foreachFumitoshi Ukai2015-04-111-0/+2
| | | | | | | | | | | | | | | | | | | | before: % ./run_integration_test.rb android tar -xzf ../android.tgz Running make for android... 6.05 secs Running kati for android... 64.08 secs android: OK PASS! after: % ./run_integration_test.rb android tar -xzf ../android.tgz Running make for android... 5.76 secs Running kati for android... 41.54 secs android: OK PASS!
* preserve func expression to make Func.String() faster.Fumitoshi Ukai2015-04-101-5/+8
| | | | | | | | | | | | | | | | | | | | | | maybe better to revisit it's worth doing. before: % ./run_integration_test.rb android tar -xzf ../android.tgz Running make for android... 5.78 secs Running kati for android... 62.50 secs android: OK PASS! after: % ./run_integration_test.rb android tar -xzf ../android.tgz Running make for android... 5.85 secs Running kati for android... 61.93 secs android: OK PASS!
* split expression parser and evaluatorFumitoshi Ukai2015-04-101-0/+314