added ARM interpreted mode supported

This commit is contained in:
jet
2009-08-06 11:52:36 -06:00
parent 6d27274aea
commit 1ffe46a545
8 changed files with 2300 additions and 124 deletions

View File

@ -117,7 +117,11 @@ pushLong(Thread* t, uint64_t v)
inline void
pushDouble(Thread* t, double v)
{
pushLong(t, doubleToBits(v));
uint64_t w = doubleToBits(v);
#ifdef __arm__
w = w << 32 | w >> 32;
#endif
pushLong(t, w);
}
inline object
@ -167,10 +171,14 @@ popLong(Thread* t)
return (b << 32) | a;
}
inline float
inline double
popDouble(Thread* t)
{
return bitsToDouble(popLong(t));
uint64_t v = popLong(t);
#ifdef __arm__
v = v << 32 | v >> 32;
#endif
return bitsToDouble(v);
}
inline object
@ -560,8 +568,17 @@ pushResult(Thread* t, unsigned returnCode, uint64_t result, bool indirect)
pushInt(t, result);
break;
case LongField:
case DoubleField:
#ifdef __arm__
result = result << 32 | result >> 32;
if (DebugRun) {
fprintf(stderr, "result: %"LLD"\n", result);
}
pushLong(t, result);
break;
#endif
case LongField:
if (DebugRun) {
fprintf(stderr, "result: %"LLD"\n", result);
}
@ -611,8 +628,17 @@ marshalArguments(Thread* t, uintptr_t* args, unsigned i, unsigned count,
args[offset++] = peekInt(t, sp++);
break;
case INT64_TYPE:
case DOUBLE_TYPE: {
case DOUBLE_TYPE:
#ifdef __arm__
{
uint64_t v = peekLong(t, sp);
v = v << 32 | v >> 32;
memcpy(args + offset, &v, 8);
offset += (8 / BytesPerWord);
sp += 2;
} break;
#endif
case INT64_TYPE: {
uint64_t v = peekLong(t, sp);
memcpy(args + offset, &v, 8);
offset += (8 / BytesPerWord);