Introduce EvaluationMethod enum to enable the introduction of new interpreter.#2424
Conversation
Co-authored-by: Jimmy Miller <jimmy.miller@servicenow.com> Co-authored-by: Cam Walter <cam.n.walter@gmail.com>
50f9677 to
286e464
Compare
|
Is the idea here that there are multiple options going forward other than two? If so then fine, it's just an intrusive change to an interface we just changed recently. |
286e464 to
5840cf5
Compare
Exactly that, this is the second thing on the list for #2416. Now I've got a branch with everything laid out somewhat sensibly I'll create a draft PR for the whole thing with an explanation of the architecture and why we did it. |
|
I should point out I am not getting rid of the |
| } | ||
| } | ||
| jvmArgs = ['-XX:+BackgroundCompilation'] | ||
| jvmArgs = ['-XX:-BackgroundCompilation'] |
There was a problem hiding this comment.
As we discussed in our call, this should really be moved to its own PR
There was a problem hiding this comment.
Thanks, please take a look at this so we don't leak too much stuff together here.
There was a problem hiding this comment.
Removed. I'll make a separate PR for this.
| try { | ||
| cx.setInterpretedMode(true); // must use interpreter mode | ||
| cx.setEvaluationMethod(EvaluationMethod.Interpreter); | ||
| ; // must use interpreter mode |
There was a problem hiding this comment.
These semicolons on their own seem to be an accident
There was a problem hiding this comment.
Sorry, I thought I'd cleaned that up, but apparently I completely failed to actually push stuff.
Why not? |
|
as for changing "setInterpreterMode," we only changed this interface very recently in Rhino timescale (earlier this year if I recall, or late last year), so we should be careful. Maintaining those few old methods for backward compatibility seems pretty harmless to me at the moment. |
Co-authored-by: Jimmy Miller <jimmy.miller@servicenow.com> Co-authored-by: Cam Walter <cam.n.walter@gmail.com>
Co-authored-by: Jimmy Miller <jimmy.miller@servicenow.com> Co-authored-by: Cam Walter <cam.n.walter@gmail.com>
5840cf5 to
e38377e
Compare
|
This looks good now, thanks! |
This change introduces an enum that expresses the possible methods by which code can be evaluated and encapsulates the logic to instantiate interpreters or compilers for that method.