mirror of
https://github.com/corda/corda.git
synced 2025-01-22 12:28:11 +00:00
Ensure we align the stack before any time we might enter a C function from
generated code
This commit is contained in:
parent
b683d836c3
commit
2bfe6f0d13
@ -28,7 +28,7 @@ vmCall();
|
|||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
const bool Verbose = false;
|
const bool Verbose = false;
|
||||||
const bool DebugNatives = false;
|
const bool DebugNatives = true;
|
||||||
const bool DebugCallTable = false;
|
const bool DebugCallTable = false;
|
||||||
const bool DebugMethodTree = false;
|
const bool DebugMethodTree = false;
|
||||||
const bool DebugFrameMaps = false;
|
const bool DebugFrameMaps = false;
|
||||||
@ -1212,7 +1212,7 @@ findInterfaceMethodFromInstance(MyThread* t, object method, object instance)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
intptr_t
|
intptr_t FORCE_ALIGN
|
||||||
compareDoublesG(uint64_t bi, uint64_t ai)
|
compareDoublesG(uint64_t bi, uint64_t ai)
|
||||||
{
|
{
|
||||||
double a = bitsToDouble(ai);
|
double a = bitsToDouble(ai);
|
||||||
@ -1229,7 +1229,7 @@ compareDoublesG(uint64_t bi, uint64_t ai)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
intptr_t
|
intptr_t FORCE_ALIGN
|
||||||
compareDoublesL(uint64_t bi, uint64_t ai)
|
compareDoublesL(uint64_t bi, uint64_t ai)
|
||||||
{
|
{
|
||||||
double a = bitsToDouble(ai);
|
double a = bitsToDouble(ai);
|
||||||
@ -1246,7 +1246,7 @@ compareDoublesL(uint64_t bi, uint64_t ai)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
intptr_t
|
intptr_t FORCE_ALIGN
|
||||||
compareFloatsG(uint32_t bi, uint32_t ai)
|
compareFloatsG(uint32_t bi, uint32_t ai)
|
||||||
{
|
{
|
||||||
float a = bitsToFloat(ai);
|
float a = bitsToFloat(ai);
|
||||||
@ -1263,7 +1263,7 @@ compareFloatsG(uint32_t bi, uint32_t ai)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
intptr_t
|
intptr_t FORCE_ALIGN
|
||||||
compareFloatsL(uint32_t bi, uint32_t ai)
|
compareFloatsL(uint32_t bi, uint32_t ai)
|
||||||
{
|
{
|
||||||
float a = bitsToFloat(ai);
|
float a = bitsToFloat(ai);
|
||||||
@ -1280,79 +1280,79 @@ compareFloatsL(uint32_t bi, uint32_t ai)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t
|
uint64_t FORCE_ALIGN
|
||||||
addDouble(uint64_t b, uint64_t a)
|
addDouble(uint64_t b, uint64_t a)
|
||||||
{
|
{
|
||||||
return doubleToBits(bitsToDouble(a) + bitsToDouble(b));
|
return doubleToBits(bitsToDouble(a) + bitsToDouble(b));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t
|
uint64_t FORCE_ALIGN
|
||||||
subtractDouble(uint64_t b, uint64_t a)
|
subtractDouble(uint64_t b, uint64_t a)
|
||||||
{
|
{
|
||||||
return doubleToBits(bitsToDouble(a) - bitsToDouble(b));
|
return doubleToBits(bitsToDouble(a) - bitsToDouble(b));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t
|
uint64_t FORCE_ALIGN
|
||||||
multiplyDouble(uint64_t b, uint64_t a)
|
multiplyDouble(uint64_t b, uint64_t a)
|
||||||
{
|
{
|
||||||
return doubleToBits(bitsToDouble(a) * bitsToDouble(b));
|
return doubleToBits(bitsToDouble(a) * bitsToDouble(b));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t
|
uint64_t FORCE_ALIGN
|
||||||
divideDouble(uint64_t b, uint64_t a)
|
divideDouble(uint64_t b, uint64_t a)
|
||||||
{
|
{
|
||||||
return doubleToBits(bitsToDouble(a) / bitsToDouble(b));
|
return doubleToBits(bitsToDouble(a) / bitsToDouble(b));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t
|
uint64_t FORCE_ALIGN
|
||||||
moduloDouble(uint64_t b, uint64_t a)
|
moduloDouble(uint64_t b, uint64_t a)
|
||||||
{
|
{
|
||||||
return doubleToBits(fmod(bitsToDouble(a), bitsToDouble(b)));
|
return doubleToBits(fmod(bitsToDouble(a), bitsToDouble(b)));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t
|
uint64_t FORCE_ALIGN
|
||||||
negateDouble(uint64_t a)
|
negateDouble(uint64_t a)
|
||||||
{
|
{
|
||||||
return doubleToBits(- bitsToDouble(a));
|
return doubleToBits(- bitsToDouble(a));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t
|
uint32_t FORCE_ALIGN
|
||||||
doubleToFloat(int64_t a)
|
doubleToFloat(int64_t a)
|
||||||
{
|
{
|
||||||
return floatToBits(static_cast<float>(bitsToDouble(a)));
|
return floatToBits(static_cast<float>(bitsToDouble(a)));
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t
|
int32_t FORCE_ALIGN
|
||||||
doubleToInt(int64_t a)
|
doubleToInt(int64_t a)
|
||||||
{
|
{
|
||||||
return static_cast<int32_t>(bitsToDouble(a));
|
return static_cast<int32_t>(bitsToDouble(a));
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t
|
int64_t FORCE_ALIGN
|
||||||
doubleToLong(int64_t a)
|
doubleToLong(int64_t a)
|
||||||
{
|
{
|
||||||
return static_cast<int64_t>(bitsToDouble(a));
|
return static_cast<int64_t>(bitsToDouble(a));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t
|
uint32_t FORCE_ALIGN
|
||||||
addFloat(uint32_t b, uint32_t a)
|
addFloat(uint32_t b, uint32_t a)
|
||||||
{
|
{
|
||||||
return floatToBits(bitsToFloat(a) + bitsToFloat(b));
|
return floatToBits(bitsToFloat(a) + bitsToFloat(b));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t
|
uint32_t FORCE_ALIGN
|
||||||
subtractFloat(uint32_t b, uint32_t a)
|
subtractFloat(uint32_t b, uint32_t a)
|
||||||
{
|
{
|
||||||
return floatToBits(bitsToFloat(a) - bitsToFloat(b));
|
return floatToBits(bitsToFloat(a) - bitsToFloat(b));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t
|
uint32_t FORCE_ALIGN
|
||||||
multiplyFloat(uint32_t b, uint32_t a)
|
multiplyFloat(uint32_t b, uint32_t a)
|
||||||
{
|
{
|
||||||
return floatToBits(bitsToFloat(a) * bitsToFloat(b));
|
return floatToBits(bitsToFloat(a) * bitsToFloat(b));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t
|
uint32_t FORCE_ALIGN
|
||||||
divideFloat(uint32_t b, uint32_t a)
|
divideFloat(uint32_t b, uint32_t a)
|
||||||
{
|
{
|
||||||
return floatToBits(bitsToFloat(a) / bitsToFloat(b));
|
return floatToBits(bitsToFloat(a) / bitsToFloat(b));
|
||||||
@ -1364,7 +1364,7 @@ moduloFloat(uint32_t b, uint32_t a)
|
|||||||
return floatToBits(fmod(bitsToFloat(a), bitsToFloat(b)));
|
return floatToBits(fmod(bitsToFloat(a), bitsToFloat(b)));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t
|
uint32_t FORCE_ALIGN
|
||||||
negateFloat(uint32_t a)
|
negateFloat(uint32_t a)
|
||||||
{
|
{
|
||||||
return floatToBits(- bitsToFloat(a));
|
return floatToBits(- bitsToFloat(a));
|
||||||
@ -1382,43 +1382,43 @@ moduloLong(int64_t b, int64_t a)
|
|||||||
return a % b;
|
return a % b;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t
|
uint64_t FORCE_ALIGN
|
||||||
floatToDouble(int32_t a)
|
floatToDouble(int32_t a)
|
||||||
{
|
{
|
||||||
return doubleToBits(static_cast<double>(bitsToFloat(a)));
|
return doubleToBits(static_cast<double>(bitsToFloat(a)));
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t
|
int32_t FORCE_ALIGN
|
||||||
floatToInt(int32_t a)
|
floatToInt(int32_t a)
|
||||||
{
|
{
|
||||||
return static_cast<int32_t>(bitsToFloat(a));
|
return static_cast<int32_t>(bitsToFloat(a));
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t
|
int64_t FORCE_ALIGN
|
||||||
floatToLong(int32_t a)
|
floatToLong(int32_t a)
|
||||||
{
|
{
|
||||||
return static_cast<int64_t>(bitsToFloat(a));
|
return static_cast<int64_t>(bitsToFloat(a));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t
|
uint64_t FORCE_ALIGN
|
||||||
intToDouble(int32_t a)
|
intToDouble(int32_t a)
|
||||||
{
|
{
|
||||||
return doubleToBits(static_cast<double>(a));
|
return doubleToBits(static_cast<double>(a));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t
|
uint32_t FORCE_ALIGN
|
||||||
intToFloat(int32_t a)
|
intToFloat(int32_t a)
|
||||||
{
|
{
|
||||||
return floatToBits(static_cast<float>(a));
|
return floatToBits(static_cast<float>(a));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t
|
uint64_t FORCE_ALIGN
|
||||||
longToDouble(int64_t a)
|
longToDouble(int64_t a)
|
||||||
{
|
{
|
||||||
return doubleToBits(static_cast<double>(a));
|
return doubleToBits(static_cast<double>(a));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t
|
uint32_t FORCE_ALIGN
|
||||||
longToFloat(int64_t a)
|
longToFloat(int64_t a)
|
||||||
{
|
{
|
||||||
return floatToBits(static_cast<float>(a));
|
return floatToBits(static_cast<float>(a));
|
||||||
@ -1449,7 +1449,7 @@ makeBlankArray(MyThread* t, object (*constructor)(Thread*, uintptr_t, bool),
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uintptr_t
|
uintptr_t FORCE_ALIGN
|
||||||
lookUpAddress(int32_t key, uintptr_t* start, int32_t count,
|
lookUpAddress(int32_t key, uintptr_t* start, int32_t count,
|
||||||
uintptr_t default_)
|
uintptr_t default_)
|
||||||
{
|
{
|
||||||
|
@ -2221,7 +2221,7 @@ isAssignableFrom(Thread* t, object a, object b)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool FORCE_ALIGN
|
||||||
instanceOf(Thread* t, object class_, object o)
|
instanceOf(Thread* t, object class_, object o)
|
||||||
{
|
{
|
||||||
if (o == 0) {
|
if (o == 0) {
|
||||||
|
@ -1491,7 +1491,7 @@ mark(Thread* t, object o, unsigned offset)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void
|
inline void FORCE_ALIGN
|
||||||
set(Thread* t, object target, unsigned offset, object value)
|
set(Thread* t, object target, unsigned offset, object value)
|
||||||
{
|
{
|
||||||
cast<object>(target, offset) = value;
|
cast<object>(target, offset) = value;
|
||||||
|
Loading…
Reference in New Issue
Block a user