-
Notifications
You must be signed in to change notification settings - Fork 15
Towards a semi-performant recursive interpreter #37
Commits on Jan 27, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 786f2bc - Browse repository at this point
Copy the full SHA 786f2bcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 24a0cce - Browse repository at this point
Copy the full SHA 24a0cceView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5b27660 - Browse repository at this point
Copy the full SHA 5b27660View commit details -
Configuration menu - View commit details
-
Copy full SHA for e0feed2 - Browse repository at this point
Copy the full SHA e0feed2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4ccad0b - Browse repository at this point
Copy the full SHA 4ccad0bView commit details -
Configuration menu - View commit details
-
Copy full SHA for c4789ce - Browse repository at this point
Copy the full SHA c4789ceView commit details -
Configuration menu - View commit details
-
Copy full SHA for 971a61e - Browse repository at this point
Copy the full SHA 971a61eView commit details -
Add
enter_call(meth, args...; kwargs...)
This is essentially the new implementation of JuliaStackFrame(meth, ...). It fixes what was broken and adds keyword arg support.
Configuration menu - View commit details
-
Copy full SHA for 265c3a6 - Browse repository at this point
Copy the full SHA 265c3a6View commit details -
Improve the performance of the interpreter
This almost entirely eliminates dynamic dispatch during execution of the interpreter. On a simple sum-the-elements-of-an-array test, this results in a 2x speedup. This also eliminates lookup_var_if_var.
Configuration menu - View commit details
-
Copy full SHA for a43f96c - Browse repository at this point
Copy the full SHA a43f96cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5218791 - Browse repository at this point
Copy the full SHA 5218791View commit details -
Split JuliaStackFrame into two pieces, with code being a singleton
This avoids the need for fetching the AST and copying the CodeInfo repeatedly for the same method. This also stashes an updated pc for each frame. This seems more consistent with the notion that the state of all the locals, ssavalues, etc, is dependent on the pc, so allowing these two to diverge seems inconsistent.
Configuration menu - View commit details
-
Copy full SHA for 1f112b0 - Browse repository at this point
Copy the full SHA 1f112b0View commit details -
Configuration menu - View commit details
-
Copy full SHA for d85058a - Browse repository at this point
Copy the full SHA d85058aView commit details -
Switch interpreter/compiler decision to a trait-or-stack-based approach
This is more flexible if we want to do a wider variety of things with the stack.
Configuration menu - View commit details
-
Copy full SHA for 8449d24 - Browse repository at this point
Copy the full SHA 8449d24View commit details -
These are used when running in fully-interpreted mode to reduce the number of calls to `which`. Recently-called methods are maintained in a LRU cache at each call site; if the types match one of the cached methods, the framecode is looked up in the cache thus bypassing the need to call `which`. Building the frame itself is the biggest remaining bottleneck, in particular the allocation of storage for local variables. While this results in an order-of-magnitude improvement, the interpreter is still pretty slow, requiring of order 32us per iteration in a simple sum-a-Vector{Float64} demo. (With `--compile=no` it is more like 4us per iteration. Though I am not sure that nothing is compiled under those circumstances--- what about methods already built into the system image?)
Configuration menu - View commit details
-
Copy full SHA for 5c1cc58 - Browse repository at this point
Copy the full SHA 5c1cc58View commit details -
Switch local method tables to a "parallel" TypeMapEntry lookup
Adding an unsupported type to the CodeInfo source breaks too many things (e.g., basic-block computation, SSA usage analysis, etc.). We circumvent that by storing the local method table in a parallel structure. Some day, however, we may want to consider adding LocalMethodTable as a supported AST component; basing it on TypeMapEntry, as done here, is nevertheless a better approach than using arrays.
Configuration menu - View commit details
-
Copy full SHA for c80d4eb - Browse repository at this point
Copy the full SHA c80d4ebView commit details -
Configuration menu - View commit details
-
Copy full SHA for ccb034d - Browse repository at this point
Copy the full SHA ccb034dView commit details -
Memory allocation is a significant bottleneck; this reduces the burden. Cuts the execution time almost in half.
Configuration menu - View commit details
-
Copy full SHA for b72ae86 - Browse repository at this point
Copy the full SHA b72ae86View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0fc6936 - Browse repository at this point
Copy the full SHA 0fc6936View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1887ac9 - Browse repository at this point
Copy the full SHA 1887ac9View commit details -
Configuration menu - View commit details
-
Copy full SHA for aeddf77 - Browse repository at this point
Copy the full SHA aeddf77View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7268b36 - Browse repository at this point
Copy the full SHA 7268b36View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5d28f90 - Browse repository at this point
Copy the full SHA 5d28f90View commit details -
Work around some bugs in difficult cases
It's difficult stepping into inference because it uses some of the same types used here to mark slots/ssas, and as a consequence `lookup_var` and others can get confused. There also seem to be some issue wrt generated functions and/or keyword args. So these changes just prevent recursion in known-bad cases.
Configuration menu - View commit details
-
Copy full SHA for 993bc8a - Browse repository at this point
Copy the full SHA 993bc8aView commit details -
Configuration menu - View commit details
-
Copy full SHA for e28bb0f - Browse repository at this point
Copy the full SHA e28bb0fView commit details -
Lookup GlobalRefs during optimize!
This also necessitates changing how Builtins are handled, but this is more robust than the previous module/symbol check.
Configuration menu - View commit details
-
Copy full SHA for 670ed65 - Browse repository at this point
Copy the full SHA 670ed65View commit details -
Record position prior to entering new frame
This is needed for debugging
Configuration menu - View commit details
-
Copy full SHA for 5b3695d - Browse repository at this point
Copy the full SHA 5b3695dView commit details -
For generators, index by argtypes when caching lowered code
The generator can in principle return arbitrary expressions depending on the exact type.
Configuration menu - View commit details
-
Copy full SHA for 925ec77 - Browse repository at this point
Copy the full SHA 925ec77View commit details -
Configuration menu - View commit details
-
Copy full SHA for a8610c9 - Browse repository at this point
Copy the full SHA a8610c9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2672537 - Browse repository at this point
Copy the full SHA 2672537View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9663bf7 - Browse repository at this point
Copy the full SHA 9663bf7View commit details -
Configuration menu - View commit details
-
Copy full SHA for e1983f8 - Browse repository at this point
Copy the full SHA e1983f8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7317756 - Browse repository at this point
Copy the full SHA 7317756View commit details -
Configuration menu - View commit details
-
Copy full SHA for ab0775a - Browse repository at this point
Copy the full SHA ab0775aView commit details -
Add docstrings for key interpreter methods.
This also makes minor code cleanups.
Configuration menu - View commit details
-
Copy full SHA for cdac1e9 - Browse repository at this point
Copy the full SHA cdac1e9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0be3c37 - Browse repository at this point
Copy the full SHA 0be3c37View commit details -
Configuration menu - View commit details
-
Copy full SHA for 265ae94 - Browse repository at this point
Copy the full SHA 265ae94View commit details -
At least module-scope code can use Ints for :gotoifnot expressions.
Configuration menu - View commit details
-
Copy full SHA for 2f2ca9f - Browse repository at this point
Copy the full SHA 2f2ca9fView commit details -
Actually copy the code in copy_codeinfo
Because we run the optimizer we don't want to contaminate the original.
Configuration menu - View commit details
-
Copy full SHA for 7d45fbe - Browse repository at this point
Copy the full SHA 7d45fbeView commit details -
A few improvements useful for external callers
Separates out the `JuliaFrameCode` constructor, generalizes `moduleof`, adds pc utilities
Configuration menu - View commit details
-
Copy full SHA for 0480577 - Browse repository at this point
Copy the full SHA 0480577View commit details -
checkout untagged test-deps in travis script
fixup some toml files and .travis
Configuration menu - View commit details
-
Copy full SHA for d03e44e - Browse repository at this point
Copy the full SHA d03e44eView commit details