Skip to content

Commit

Permalink
reimplement require/include to better support precompilation
Browse files Browse the repository at this point in the history
the codepaths through these methods were not particularly amenable to adding incremental precompilation.
the problem is that the cache-load code paths need to be mirrors of their non-cache counterparts.
this minimizes the code paths to running "include" to one, and similarly for "reload"/"require"
those are now limited to only handling module names (symbols), rather than arbitrary paths

this also fixes a number of issues with the incremental serializer that
have snuck in over time.
  • Loading branch information
vtjnash committed Jul 17, 2015
1 parent c8119f8 commit ef3ec3d
Show file tree
Hide file tree
Showing 21 changed files with 392 additions and 316 deletions.
4 changes: 3 additions & 1 deletion base/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,9 @@ let reqarg = Set(UTF8String["--home", "-H",
end
# load file immediately on all processors
if opts.load != C_NULL
require(bytestring(opts.load))
let file = bytestring(opts.load), cwd = pwd()
@everywhere include($file, (1, $cwd))
end
end
# eval expression
if opts.eval != C_NULL
Expand Down
2 changes: 1 addition & 1 deletion base/docs/basedocs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ function is typically used to load source interactively, or to
combine files in packages that are broken into multiple source
files.
"""
include_from_node1
base_include

"""
0 (zero; BrE: `/ˈzɪərəʊ/` or AmE: `/ˈziːroʊ/`) is both a number and the numerical digit used to represent that number in numerals. It fulfills a central role in mathematics as the additive identity of the integers, real numbers, and many other algebraic structures. As a digit, 0 is used as a placeholder in place value systems. Names for the number 0 in English include zero, nought or (US) naught (`/ˈnɔːt/`), nil, or — in contexts where at least one adjacent digit distinguishes it from the letter "O" — oh or o (`/ˈoʊ/`). Informal or slang terms for zero include zilch and zip. Ought and aught (/ˈɔːt/), as well as cipher, have also been used historically.
Expand Down
1 change: 0 additions & 1 deletion base/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,6 @@ export
include,
include_string,
reload,
require,

# RTS internals
finalizer,
Expand Down
1 change: 0 additions & 1 deletion base/interactiveutil.jl
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ function workspace()
Expr(:toplevel,
:(const Base = $(Expr(:quote, b))),
:(const LastMain = $(Expr(:quote, last)))))
empty!(package_list)
empty!(package_locks)
nothing
end
Expand Down
Loading

0 comments on commit ef3ec3d

Please sign in to comment.