Fix toplevel method visibility in jit/fullint script scopes. #5358
Toplevel scopes were only getting defaulted to private visibility
This fixes regression in test:jruby:aot test_timeout.rb toplevel
The text was updated successfully, but these errors were encountered:
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).