(ExecutionContext context)
| 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() { |
no test coverage detected