Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.7.0.pre2
    • Fix Version/s: JRuby 1.7.0.RC1
    • Component/s: Embedding
    • Labels:
      None
    • Environment:
      jruby 1.7.0.preview2 (1.9.3p203) 2012-08-10 82eb396 on Java HotSpot(TM) 64-Bit Server VM 1.6.0_33-b03-424-11M3720 [darwin-x86_64]
      Also verified on Ruboto.
    • Testcase included:
      yes
    • Number of attachments :
      0

      Description

      I have some questions:

      Firstly, what should the default value for compile mode be when using the ScriptingContainer? I would expect this to be the same as when running JRuby in other ways, that is JIT. It currently defaults to OFF.

      More importantly, the system property jruby.compile.mode is not respected when set to OFFIR, and I think it should.

      Failing test:

          @Test
          public void testSetCompileModeBySystemPropertyOFFIR() {
              System.setProperty("jruby.compile.mode", "OFFIR");
              ScriptingContainer instance = new ScriptingContainer(LocalContextScope.THREADSAFE);
              instance.put("MEANING", 42);
              instance.runScriptlet("puts MEANING");
              assertEquals(CompileMode.OFFIR, instance.getCompileMode());
          }
      

      I'd like to fix this. Please advise if it is a good idea.

      Lastly, what is the setting if you want to use IR JIT? The settings for compile mode I can find are JIT, FORCE, FORCEIR, OFF, OFFIR. What about JITIR?

      All info is appreciated.

        Activity

        Hide
        Charles Oliver Nutter added a comment -

        I think the property to set compile/jit mode are only read once, and may be static. This complicates making them configurable.

        I'll look into improving the config APIs relating to this so we can at least get it to be configurable after boot time.

        Show
        Charles Oliver Nutter added a comment - I think the property to set compile/jit mode are only read once, and may be static. This complicates making them configurable. I'll look into improving the config APIs relating to this so we can at least get it to be configurable after boot time.
        Hide
        Charles Oliver Nutter added a comment -

        Hmm, ok...so the method you need to be able to set is RubyInstanceConfig.setCompileMode(). I believe that will be honored by all paths that make decisions between compilation and JIT. Can you explore that angle?

        Show
        Charles Oliver Nutter added a comment - Hmm, ok...so the method you need to be able to set is RubyInstanceConfig.setCompileMode(). I believe that will be honored by all paths that make decisions between compilation and JIT. Can you explore that angle?
        Hide
        Charles Oliver Nutter added a comment -

        Oh, and I think ScriptingContainer should default to JIT like regular execution, and match regular execution's default mode in the future (which might be "JITIR" or something eventually).

        Show
        Charles Oliver Nutter added a comment - Oh, and I think ScriptingContainer should default to JIT like regular execution, and match regular execution's default mode in the future (which might be "JITIR" or something eventually).
        Hide
        Uwe Kubosch added a comment -

        Committed a fix where we don't set compile mode to OFF for ScriptingContainer. This also allows the setting to be configured by Java system property.

        Show
        Uwe Kubosch added a comment - Committed a fix where we don't set compile mode to OFF for ScriptingContainer. This also allows the setting to be configured by Java system property.

          People

          • Assignee:
            Unassigned
            Reporter:
            Uwe Kubosch
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: