Skip to content
This repository was archived by the owner on Aug 20, 2018. It is now read-only.

Commit 83fcc77

Browse files
author
Marco
committed
Merge pull request #1833 from mykmelez/intex-enable-compiler
enable compiler on intex branch
2 parents 819eb8b + 59a3fc1 commit 83fcc77

File tree

4 files changed

+16
-18
lines changed

4 files changed

+16
-18
lines changed

tests/automation.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ function syncFS() {
180180
});
181181
}
182182

183-
casper.test.begin("unit tests", 37 + gfxTests.length, function(test) {
183+
casper.test.begin("unit tests", 39 + gfxTests.length, function(test) {
184184
casper.start("data:text/plain,start");
185185

186186
casper.page.onLongRunningScript = function(message) {
@@ -226,17 +226,15 @@ casper.test.begin("unit tests", 37 + gfxTests.length, function(test) {
226226
.thenOpen("http://localhost:8000/index.html?logConsole=web,page&logLevel=log")
227227
.withFrame(0, basicUnitTests);
228228

229-
// TODO: Re-enable rerunning tests once we re-enable the JIT.
230-
231229
// Run the same unit tests again to test the compiled method cache.
232-
/*casper
230+
casper
233231
.thenOpen("http://localhost:8000/index.html?logConsole=web,page&logLevel=log")
234232
.withFrame(0, basicUnitTests);
235233

236234
// Run the same unit tests again with baseline JIT enabled for all methods.
237235
casper
238236
.thenOpen("http://localhost:8000/index.html?logConsole=web,page&logLevel=log&forceRuntimeCompilation=1")
239-
.withFrame(0, basicUnitTests);*/
237+
.withFrame(0, basicUnitTests);
240238

241239
casper
242240
.thenOpen("http://localhost:8000/index.html?main=tests/isolate/TestIsolate&logLevel=info&logConsole=web,page,raw")

tests/com/sun/midp/crypto/TestBouncyCastleSHA256.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import gnu.testlet.Testlet;
66

77
public class TestBouncyCastleSHA256 implements Testlet {
8-
public int getExpectedPass() { return 6; }
8+
public int getExpectedPass() { return 7; }
99
public int getExpectedFail() { return 0; }
1010
public int getExpectedKnownFail() { return 0; }
1111

@@ -40,12 +40,10 @@ public void test(TestHarness th) {
4040
th.check(Util.hexEncode(retValue).toLowerCase(), digests[i]);
4141
}
4242

43-
/* TODO: Re-enable when compilation is enabled.
44-
4543
for (int i = 0; i < 1000000; i++) {
4644
md.update((byte)'a');
4745
}
4846
md.doFinal(retValue, 0);
49-
th.check(Util.hexEncode(retValue).toLowerCase(), MILLION_A_DIGEST);*/
47+
th.check(Util.hexEncode(retValue).toLowerCase(), MILLION_A_DIGEST);
5048
}
5149
}

tests/com/sun/midp/crypto/TestClasspathSHA256.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import gnu.testlet.Testlet;
66

77
public class TestClasspathSHA256 implements Testlet {
8-
public int getExpectedPass() { return 6; }
8+
public int getExpectedPass() { return 7; }
99
public int getExpectedFail() { return 0; }
1010
public int getExpectedKnownFail() { return 0; }
1111

@@ -38,11 +38,9 @@ public void test(TestHarness th) {
3838
th.check(Util.hexEncode(md.digest()).toLowerCase(), digests[i]);
3939
}
4040

41-
/* TODO: Re-enable when compilation is enabled.
42-
4341
for (int i = 0; i < 1000000; i++) {
4442
md.update((byte)'a');
4543
}
46-
th.check(Util.hexEncode(md.digest()).toLowerCase(), MILLION_A_DIGEST);*/
44+
th.check(Util.hexEncode(md.digest()).toLowerCase(), MILLION_A_DIGEST);
4745
}
4846
}

vm/runtime.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ module J2ME {
6565
/**
6666
* Turns on just-in-time compilation of methods.
6767
*/
68-
export var enableRuntimeCompilation = false;
68+
export var enableRuntimeCompilation = true;
6969

7070
/**
7171
* Turns on onStackReplacement
@@ -666,10 +666,14 @@ module J2ME {
666666
TWO_PWR_32_DBL = 4294967296,
667667
TWO_PWR_63_DBL = 9223372036854776000,
668668

669-
// The target amount of free memory(in bytes) before garbage collection is forced on unwind.
670-
// Note: This number was chosen somewhat randomly to allow some space for allocation
671-
// during forceCollection, though it has not been verified it needs any space.
672-
FREE_MEMORY_TARGET = 4086,
669+
// The target amount of free memory (in bytes) before garbage collection is forced on unwind.
670+
// Note: This number was chosen through ad-hoc testing of a midlet, which showed
671+
// that the midlet OOMed once less than ~3MB of memory was available, presumably
672+
// because compiled codeis allocating more than that before unwinding. It would be
673+
// useful to have more insight into which code allocates memory, and in what chunks,
674+
// so we can set this to the maximum amount of memory needed by compiled code.
675+
// But this value seems to work ok in the meantime.
676+
FREE_MEMORY_TARGET = 4 * 1024 * 1024, // 4MiB
673677

674678
// The size in bytes of the header in the memory allocated to the object.
675679
OBJ_HDR_SIZE = 8,

0 commit comments

Comments
 (0)