Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/jl_exported_funcs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@
XX(jl_read_verify_header) \
XX(jl_realloc) \
XX(jl_register_newmeth_tracer) \
XX(jl_resolve_globals_in_ir) \
XX(jl_resolve_definition_effects_in_ir) \
XX(jl_restore_excstack) \
XX(jl_restore_incremental) \
XX(jl_restore_package_image_from_file) \
Expand Down
14 changes: 10 additions & 4 deletions src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -3683,11 +3683,17 @@ f(x) = yt(x)
(else
(error (string "invalid assignment location \"" (deparse var) "\"")))))

(define (sig-type-expr namemap name expr)
(let ((newname (get namemap name expr)))
(if (symbol? newname)
`(globalref (thismodule) ,newname)
newname)))

(define (rename-sig-types ex namemap)
(pattern-replace
(pattern-set
(pattern-lambda (call (core (-/ Typeof)) name)
(get namemap name __)))
(sig-type-expr namemap name __)))
ex))

;; replace leading (function) argument type with `typ`
Expand Down Expand Up @@ -4242,7 +4248,7 @@ f(x) = yt(x)
(contains (lambda (x) (eq? x 'kwftype)) sig))
(renamemap (map cons closure-param-names closure-param-syms))
(arg-defs (replace-vars
(fix-function-arg-type sig type-name iskw namemap closure-param-syms)
(fix-function-arg-type sig `(globalref (thismodule) ,type-name) iskw namemap closure-param-syms)
renamemap)))
(append (map (lambda (gs tvar)
(make-assignment gs `(call (core TypeVar) ',tvar (core Any))))
Expand Down Expand Up @@ -4270,8 +4276,8 @@ f(x) = yt(x)
`(call (core _typeof_captured_variable) ,ve)))
capt-vars var-exprs)))))
`(new ,(if (null? P)
type-name
`(call (core apply_type) ,type-name ,@P))
`(globalref (thismodule) ,type-name)
`(call (core apply_type) (globalref (thismodule) ,type-name) ,@P))
,@var-exprs))))
(if (pair? moved-vars)
(set-car! (lam:vinfo lam)
Expand Down
4 changes: 2 additions & 2 deletions src/julia_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -717,8 +717,8 @@ jl_value_t *jl_code_or_ci_for_interpreter(jl_method_instance_t *lam JL_PROPAGATE
int jl_code_requires_compiler(jl_code_info_t *src, int include_force_compile);
jl_code_info_t *jl_new_code_info_from_ir(jl_expr_t *ast);
JL_DLLEXPORT jl_code_info_t *jl_new_code_info_uninit(void);
JL_DLLEXPORT void jl_resolve_globals_in_ir(jl_array_t *stmts, jl_module_t *m, jl_svec_t *sparam_vals,
int binding_effects);
JL_DLLEXPORT void jl_resolve_definition_effects_in_ir(jl_array_t *stmts, jl_module_t *m, jl_svec_t *sparam_vals,
int binding_effects);

int get_next_edge(jl_array_t *list, int i, jl_value_t** invokesig, jl_code_instance_t **caller) JL_NOTSAFEPOINT;
int set_next_edge(jl_array_t *list, int i, jl_value_t *invokesig, jl_code_instance_t *caller);
Expand Down
Loading
Loading