Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [omr-dev] How to avoid OMR compiler static instance

Hm, actually after a deeper look into the code for JitConfig, it doesn't look like OpenJ9 uses TR::JitConfig::instance(). The global state can be seen in omr/compiler/env/JitConfig.hpp, some examples of where you'd only want one value is the vlogFileName and vlogFile file handle. There's also the _pseudoTOC (used only on power). The Monitor Table, AFAICT, is only used in OpenJ9.

As long as each Lua VM instance runs with the same compiler options, and shares the same code cache (so that the _pseudoTOC can be shared), I think this global state shouldn't pose a problem.

Regards,

Irwin D'Souza
JIT Compiler Developer
IBM Runtime Technologies
Email: dsouzai@xxxxxxxxxx
Phone: 905-413-2956


Inactive hide details for Dibyendu Majumdar ---05/31/2018 04:14:32 PM---On 31 May 2018 at 20:55, Irwin D'Souza <dsouzai@xxxxxx.Dibyendu Majumdar ---05/31/2018 04:14:32 PM---On 31 May 2018 at 20:55, Irwin D'Souza <dsouzai@xxxxxxxxxx> wrote: >

From: Dibyendu Majumdar <mobile@xxxxxxxxxxxxxxx>
To: omr developer discussions <omr-dev@xxxxxxxxxxx>
Date: 05/31/2018 04:14 PM
Subject: Re: [omr-dev] How to avoid OMR compiler static instance
Sent by: omr-dev-bounces@xxxxxxxxxxx







On 31 May 2018 at 20:55, Irwin D'Souza <dsouzai@xxxxxxxxxx> wrote:

    I believe the JitConfig is a singleton because it holds some global variables that are used at least in downstream projects such as OpenJ9. The MonitorTable is a singleton because it is a single repository that the compiler can use to get hold of monitors it might need; again, this is something that OpenJ9 uses.


Okay. It would be nice to document what is global state and why. 
    What use case are you considering that would benefit from these objects not being singletons?

Depending on what is maintained globally it might not be a big issue. An immediate issue is having to initialize the global state - I work with Lua VM which is designed such that multiple instances can be easily created. Often users can create these instances and I don't have control over that. Having global state means I need to somehow initialize the state / and cleanup too - but how/when?  Right now I am trying out a reference counting approach for this. 

Regards
Dibyendu_______________________________________________
omr-dev mailing list
omr-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/omr-dev




Back to the top