MCPcopy Create free account
hub / github.com/dynjs/dynjs / tryCompile

Method tryCompile

src/main/java/org/dynjs/ir/IRJSFunction.java:125–148  ·  view source on GitHub ↗
(ExecutionContext context)

Source from the content-addressed store, hash-verified

123 }
124
125 private boolean tryCompile(ExecutionContext context) {
126 if (box.compiledFunction != null) {
127 return true;
128 }
129
130 if (box.callCount++ >= context.getConfig().getJitThreshold()) {
131 box.callCount = -1; // disable, we get one shot
132 if (!box.compilationInProgress) {
133 if (context.getConfig().isJitEnabled()) {
134 final JITCompiler compiler = context.getRuntime().getJitCompiler();
135 box.compilationInProgress = true;
136 compiler.compile(context, this, new JITCompiler.CompilerCallback() {
137 @Override
138 public void done(JSFunction compiledFunction) {
139 box.compiledFunction = compiledFunction;
140 }
141 });
142 }
143
144 }
145
146 }
147 return false;
148 }
149
150 @Override
151 public boolean isStrict() {

Callers 1

callMethod · 0.95

Calls 6

compileMethod · 0.95
getJitThresholdMethod · 0.80
isJitEnabledMethod · 0.80
getJitCompilerMethod · 0.80
getConfigMethod · 0.65
getRuntimeMethod · 0.45

Tested by

no test coverage detected