Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the interpreter loop to avoid performance degradation. #1777

Merged
merged 2 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ public class BuiltinBenchmark {
@State(Scope.Thread)
public static class AbstractClassState {

@Param({"false", "true"})
public boolean interpreted;

public void init()
throws IllegalAccessException, InvocationTargetException, InstantiationException {
cx = Context.enter();
cx.setInterpretedMode(interpreted);
cx.setLanguageVersion(Context.VERSION_ES6);

scope = cx.initStandardObjects();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ public static class MathState {
Function bitwiseRsh;
Function bitwiseSignedRsh;

@Param({"false", "true"})
public boolean interpreted;

@Setup(Level.Trial)
public void setup() throws IOException {
cx = Context.enter();
cx.setInterpretedMode(interpreted);
cx.setLanguageVersion(Context.VERSION_ES6);
scope = cx.initStandardObjects();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,14 @@ public static class FieldTestState {
Scriptable strings;
Scriptable ints;

@Param({"false", "true"})
public boolean interpreted;

@Setup(Level.Trial)
@SuppressWarnings("unused")
public void create() throws IOException {
cx = Context.enter();
cx.setInterpretedMode(interpreted);
cx.setLanguageVersion(Context.VERSION_ES6);

scope = new Global(cx);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ public static class PropertyState {

Object object;

@Param({"false", "true"})
public boolean interpreted;

@Setup(Level.Trial)
public void setup() throws IOException {
cx = Context.enter();
cx.setInterpretedMode(interpreted);
cx.setLanguageVersion(Context.VERSION_ES6);
scope = cx.initStandardObjects();

Expand Down
Loading
Loading