mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +00:00
lots of bugfixes - finally got Simple.pow() working
This commit is contained in:
parent
bd9e8a77e2
commit
606e5cb238
@ -358,11 +358,11 @@ localOffset(MyThread* t, int v, object method)
|
|||||||
+ parameterFootprint
|
+ parameterFootprint
|
||||||
+ (t->arch->frameFooterSize() * 2)
|
+ (t->arch->frameFooterSize() * 2)
|
||||||
+ t->arch->frameHeaderSize()
|
+ t->arch->frameHeaderSize()
|
||||||
- v) :
|
- v - 1) :
|
||||||
(frameSize
|
(frameSize
|
||||||
+ parameterFootprint
|
+ parameterFootprint
|
||||||
+ t->arch->frameFooterSize()
|
+ t->arch->frameFooterSize()
|
||||||
- v)) * BytesPerWord;
|
- v - 1)) * BytesPerWord;
|
||||||
|
|
||||||
assert(t, offset >= 0);
|
assert(t, offset >= 0);
|
||||||
return offset;
|
return offset;
|
||||||
@ -3869,7 +3869,7 @@ finish(MyThread* t, Context* context)
|
|||||||
strcmp
|
strcmp
|
||||||
(reinterpret_cast<const char*>
|
(reinterpret_cast<const char*>
|
||||||
(&byteArrayBody(t, methodName(t, context->method), 0)),
|
(&byteArrayBody(t, methodName(t, context->method), 0)),
|
||||||
"main") == 0)
|
"pow") == 0)
|
||||||
{
|
{
|
||||||
asm("int3");
|
asm("int3");
|
||||||
}
|
}
|
||||||
|
556
src/compiler.cpp
556
src/compiler.cpp
File diff suppressed because it is too large
Load Diff
27
src/x86.cpp
27
src/x86.cpp
@ -1351,12 +1351,8 @@ class MyArchitecture: public Assembler::Architecture {
|
|||||||
|
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case Compare:
|
case Compare:
|
||||||
if (BytesPerWord == 8 and aSize != 8) {
|
*aTypeMask = (1 << RegisterOperand) | (1 << ConstantOperand);
|
||||||
*aTypeMask = ~(1 << MemoryOperand);
|
*bTypeMask = (1 << RegisterOperand);
|
||||||
*bTypeMask = ~((1 << MemoryOperand) | (1 << ConstantOperand));
|
|
||||||
} else {
|
|
||||||
*bTypeMask = ~(1 << ConstantOperand);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Move:
|
case Move:
|
||||||
@ -1387,10 +1383,10 @@ class MyArchitecture: public Assembler::Architecture {
|
|||||||
unsigned, uint8_t* cTypeMask, uint64_t* cRegisterMask,
|
unsigned, uint8_t* cTypeMask, uint64_t* cRegisterMask,
|
||||||
bool* thunk)
|
bool* thunk)
|
||||||
{
|
{
|
||||||
*aTypeMask = ~0;
|
*aTypeMask = (1 << RegisterOperand) | (1 << ConstantOperand);
|
||||||
*aRegisterMask = ~static_cast<uint64_t>(0);
|
*aRegisterMask = ~static_cast<uint64_t>(0);
|
||||||
|
|
||||||
*bTypeMask = (1 << RegisterOperand) | (1 << MemoryOperand);
|
*bTypeMask = (1 << RegisterOperand);
|
||||||
*bRegisterMask = ~static_cast<uint64_t>(0);
|
*bRegisterMask = ~static_cast<uint64_t>(0);
|
||||||
|
|
||||||
*thunk = false;
|
*thunk = false;
|
||||||
@ -1427,7 +1423,6 @@ class MyArchitecture: public Assembler::Architecture {
|
|||||||
case ShiftLeft:
|
case ShiftLeft:
|
||||||
case ShiftRight:
|
case ShiftRight:
|
||||||
case UnsignedShiftRight: {
|
case UnsignedShiftRight: {
|
||||||
*aTypeMask = (1 << RegisterOperand) | (1 << ConstantOperand);
|
|
||||||
*aRegisterMask = (~static_cast<uint64_t>(0) << 32)
|
*aRegisterMask = (~static_cast<uint64_t>(0) << 32)
|
||||||
| (static_cast<uint64_t>(1) << rcx);
|
| (static_cast<uint64_t>(1) << rcx);
|
||||||
const uint32_t mask = ~(1 << rcx);
|
const uint32_t mask = ~(1 << rcx);
|
||||||
@ -1570,17 +1565,21 @@ class MyAssembler: public Assembler {
|
|||||||
|
|
||||||
for (MyBlock* b = c.firstBlock; b; b = b->next) {
|
for (MyBlock* b = c.firstBlock; b; b = b->next) {
|
||||||
unsigned index = 0;
|
unsigned index = 0;
|
||||||
|
unsigned padding = 0;
|
||||||
for (AlignmentPadding* p = b->firstPadding; p; p = p->next) {
|
for (AlignmentPadding* p = b->firstPadding; p; p = p->next) {
|
||||||
unsigned size = p->offset - b->offset;
|
unsigned size = p->offset - b->offset;
|
||||||
memcpy(dst + b->start + index, c.code.data + b->offset + index, size);
|
memcpy(dst + b->start + index + padding,
|
||||||
|
c.code.data + b->offset + index,
|
||||||
|
size);
|
||||||
index += size;
|
index += size;
|
||||||
while ((b->start + index + 1) % 4) {
|
while ((b->start + index + padding + 1) % 4) {
|
||||||
*(dst + b->start + index) = 0x90;
|
*(dst + b->start + index + padding) = 0x90;
|
||||||
++ index;
|
++ padding;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(dst + b->start + index, c.code.data + b->offset + index,
|
memcpy(dst + b->start + index + padding,
|
||||||
|
c.code.data + b->offset + index,
|
||||||
b->size - index);
|
b->size - index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user