зеркало из https://github.com/mozilla/pluotsorbet.git
Run basic unit tests with JIT compilation forcibly enabled for all methods
This commit is contained in:
Родитель
1ddcbaa23a
Коммит
acb0c57de6
|
@ -23,6 +23,7 @@
|
|||
* autosize
|
||||
* fontSize
|
||||
* language
|
||||
* forceRuntimeCompilation
|
||||
*
|
||||
* Keep this list up-to-date!
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module J2ME {
|
||||
declare var util;
|
||||
declare var util, config;
|
||||
declare var Promise;
|
||||
|
||||
import BytecodeStream = Bytecode.BytecodeStream;
|
||||
|
@ -245,9 +245,11 @@ module J2ME {
|
|||
// for synthetic method frames which have bad max_local counts.
|
||||
|
||||
// Inline heuristics that trigger JIT compilation here.
|
||||
if (enableRuntimeCompilation &&
|
||||
mi.state < MethodState.Compiled && // Give up if we're at this state.
|
||||
mi.stats.backwardsBranchCount + mi.stats.interpreterCallCount > 10) {
|
||||
if ((enableRuntimeCompilation &&
|
||||
mi.state < MethodState.Compiled && // Give up if we're at this state.
|
||||
mi.stats.backwardsBranchCount + mi.stats.interpreterCallCount > 10) ||
|
||||
config.forceRuntimeCompilation) {
|
||||
try { console.log("COMPILE"); } catch (e) {}
|
||||
compileAndLinkMethod(mi);
|
||||
}
|
||||
|
||||
|
|
|
@ -157,6 +157,11 @@ casper.test.begin("unit tests", 20 + gfxTests.length, function(test) {
|
|||
.thenOpen("http://localhost:8000/index.html?logConsole=web,page&logLevel=log")
|
||||
.withFrame(0, basicUnitTests);
|
||||
|
||||
// Run the same unit tests again with baseline JIT enabled for all methods.
|
||||
casper
|
||||
.thenOpen("http://localhost:8000/index.html?logConsole=web,page&logLevel=log&forceRuntimeCompilation=1")
|
||||
.withFrame(0, basicUnitTests);
|
||||
|
||||
casper
|
||||
.thenOpen("http://localhost:8000/index.html?main=tests/isolate/TestIsolate&logLevel=info&logConsole=web,page,raw")
|
||||
.withFrame(0, function() {
|
||||
|
|
|
@ -40,7 +40,7 @@ declare var throwPause;
|
|||
declare var throwYield;
|
||||
|
||||
module J2ME {
|
||||
declare var Native, Override;
|
||||
declare var Native, Override, config;
|
||||
declare var VM;
|
||||
declare var CompiledMethodCache;
|
||||
|
||||
|
@ -1699,7 +1699,7 @@ module J2ME {
|
|||
}
|
||||
|
||||
// Don't compile methods that are too large.
|
||||
if (methodInfo.codeAttribute.code.length > 2000) {
|
||||
if (methodInfo.codeAttribute.code.length > 2000 && !config.forceRuntimeCompilation) {
|
||||
jitWriter && jitWriter.writeLn("Not compiling: " + methodInfo.implKey + " because it's too large. " + methodInfo.codeAttribute.code.length);
|
||||
methodInfo.state = MethodState.NotCompiled;
|
||||
return;
|
||||
|
|
Загрузка…
Ссылка в новой задаче