Skip to content

Commit 81d731f

Browse files
committed
Revert revert.
1 parent 1bbdff8 commit 81d731f

13 files changed

+121
-733
lines changed

Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ MAIN_JS_SRCS = \
9999
libs/load.js \
100100
libs/zipfile.js \
101101
libs/jarstore.js \
102-
libs/long.js \
103102
libs/encoding.js \
104103
libs/fs.js \
105104
libs/fs-init.js \

int.ts

+5-20
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,6 @@ module J2ME {
5353

5454
export var onStackReplacementCount = 0;
5555

56-
/**
57-
* The closest floating-point representation to this long value.
58-
*/
59-
export function longToNumber(l: number, h: number): number {
60-
return h * Constants.TWO_PWR_32_DBL + ((l >= 0) ? l : Constants.TWO_PWR_32_DBL + l);
61-
}
62-
63-
export function numberToLong(v: number): number {
64-
// TODO Extract logic from Long so we don't allocate here.
65-
var long = Long.fromNumber(v);
66-
tempReturn0 = long.high_;
67-
return long.low_;
68-
}
69-
7056
function wordsToDouble(l: number, h: number): number {
7157
aliasedI32[0] = l;
7258
aliasedI32[1] = h;
@@ -1444,9 +1430,9 @@ module J2ME {
14441430
}
14451431
continue;
14461432
case Bytecodes.F2L:
1447-
i32[sp - 1] = returnLongValue(f32[sp - 1]);
1448-
i32[sp] = tempReturn0;
1449-
sp++;
1433+
var F2L_fa = f32[--sp];
1434+
i32[sp++] = returnLongValue(F2L_fa);
1435+
i32[sp++] = tempReturn0;
14501436
continue;
14511437
case Bytecodes.F2D:
14521438
aliasedF64[0] = f32[--sp];
@@ -1477,9 +1463,8 @@ module J2ME {
14771463
i32[sp - 2] = Constants.LONG_MIN_LOW;
14781464
i32[sp - 1] = Constants.LONG_MIN_HIGH;
14791465
} else {
1480-
value = Long.fromNumber(D2L_fa);
1481-
i32[sp - 2] = value.low_;
1482-
i32[sp - 1] = value.high_;
1466+
i32[sp - 2] = returnLongValue(D2L_fa);
1467+
i32[sp - 1] = tempReturn0;
14831468
}
14841469
continue;
14851470
case Bytecodes.D2F:

jsc.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ module J2ME {
8989
}
9090
}
9191

92-
loadFiles("libs/long.js", "blackBox.js", "bld/j2me-jsc.js", "libs/zipfile.js", "libs/jarstore.js", "libs/encoding.js", "util.js");
92+
loadFiles("blackBox.js", "bld/j2me-jsc.js", "libs/zipfile.js", "libs/jarstore.js", "libs/encoding.js", "util.js");
9393

9494
phase = ExecutionPhase.Compiler;
9595

jsshell.js

-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ try {
178178
"libs/encoding.js",
179179
"util.js",
180180
"libs/jarstore.js",
181-
"libs/long.js",
182181
"native.js",
183182
"midp/content.js",
184183
"midp/midp.js",

0 commit comments

Comments
 (0)