Skip to content

Fix toplevel method visibility in jit/fullint script scopes.#5358

Merged
headius merged 1 commit intojruby:masterfrom
headius:toplevel_visibility_in_jit
Oct 11, 2018
Merged

Fix toplevel method visibility in jit/fullint script scopes.#5358
headius merged 1 commit intojruby:masterfrom
headius:toplevel_visibility_in_jit

Conversation

@headius
Copy link
Member

@headius headius commented Oct 11, 2018

Toplevel scopes were only getting defaulted to private visibility
for the startup interpreter, which does not ever use in-IR call
protocol. When the toplevel script body is first optimized to
fullint or compiled to bytecode, call protocol is installed with
no external preamble code to set visibility to private, so the
visibility was defaulting back to public as in non-script scopes.
This change adds visibility to the frame push instruction, so top-
level scripts will use private in their frame push.

This fixes regression in test:jruby:aot test_timeout.rb toplevel
timeout test, which relied on the non-self call to timeout to see
the toplevel private method and trigger method_missing. This began
to fail with my timeout update because the method is now defined
in Ruby code rather than manually in Java code (the latter of
which explicitly set private visibility).

Toplevel scopes were only getting defaulted to private visibility
for the startup interpreter, which does not ever use in-IR call
protocol. When the toplevel script body is first optimized to
fullint or compiled to bytecode, call protocol is installed with
no external preamble code to set visibility to private, so the
visibility was defaulting back to public as in non-script scopes.
This change adds visibility to the frame push instruction, so top-
level scripts will use private in their frame push.

This fixes regression in test:jruby:aot test_timeout.rb toplevel
timeout test, which relied on the non-self call to timeout to see
the toplevel private method and trigger method_missing. This began
to fail with my timeout update because the method is now defined
in Ruby code rather than manually in Java code (the latter of
which explicitly set private visibility).
@headius headius added this to the JRuby 9.2.1.0 milestone Oct 11, 2018
@headius headius merged commit ba9583f into jruby:master Oct 11, 2018
@headius headius deleted the toplevel_visibility_in_jit branch October 11, 2018 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant