mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +00:00
snapshot
This commit is contained in:
parent
5dad9bddd6
commit
d25da6116a
@ -5353,7 +5353,7 @@ finish(MyThread* t, Allocator* allocator, Context* context)
|
|||||||
(&byteArrayBody(t, methodSpec(t, context->method), 0)));
|
(&byteArrayBody(t, methodSpec(t, context->method), 0)));
|
||||||
|
|
||||||
// for debugging:
|
// for debugging:
|
||||||
if (//false and
|
if (false and
|
||||||
::strcmp
|
::strcmp
|
||||||
(reinterpret_cast<const char*>
|
(reinterpret_cast<const char*>
|
||||||
(&byteArrayBody(t, className(t, methodClass(t, context->method)), 0)),
|
(&byteArrayBody(t, className(t, methodClass(t, context->method)), 0)),
|
||||||
|
@ -19,9 +19,9 @@ namespace local {
|
|||||||
|
|
||||||
const bool DebugAppend = true;
|
const bool DebugAppend = true;
|
||||||
const bool DebugCompile = true;
|
const bool DebugCompile = true;
|
||||||
const bool DebugResources = false;
|
const bool DebugResources = true;
|
||||||
const bool DebugFrame = false;
|
const bool DebugFrame = false;
|
||||||
const bool DebugControl = false;
|
const bool DebugControl = true;
|
||||||
const bool DebugReads = true;
|
const bool DebugReads = true;
|
||||||
const bool DebugSites = true;
|
const bool DebugSites = true;
|
||||||
const bool DebugMoves = false;
|
const bool DebugMoves = false;
|
||||||
@ -1384,11 +1384,15 @@ pickTarget(Context* c, Read* read, bool intersectRead,
|
|||||||
= (c->availableGeneralRegisterCount > registerReserveCount
|
= (c->availableGeneralRegisterCount > registerReserveCount
|
||||||
? 0 : Target::LowRegisterPenalty);
|
? 0 : Target::LowRegisterPenalty);
|
||||||
|
|
||||||
SiteMask mask;
|
Value* value = read->value;
|
||||||
|
|
||||||
|
uint32_t registerMask = (value->type == ValueGeneral
|
||||||
|
? c->arch->generalRegisterMask() : ~0);
|
||||||
|
|
||||||
|
SiteMask mask(~0, registerMask, AnyFrameIndex);
|
||||||
read->intersect(&mask);
|
read->intersect(&mask);
|
||||||
|
|
||||||
Target best;
|
Target best;
|
||||||
Value* value = read->value;
|
|
||||||
|
|
||||||
Value* successor = read->successor();
|
Value* successor = read->successor();
|
||||||
if (successor) {
|
if (successor) {
|
||||||
@ -1418,7 +1422,7 @@ pickTarget(Context* c, Read* read, bool intersectRead,
|
|||||||
return best;
|
return best;
|
||||||
}
|
}
|
||||||
|
|
||||||
{ Target mine = pickRegisterTarget(c, value, ~0);
|
{ Target mine = pickRegisterTarget(c, value, registerMask);
|
||||||
|
|
||||||
mine.cost += registerPenalty;
|
mine.cost += registerPenalty;
|
||||||
|
|
||||||
@ -3268,6 +3272,7 @@ grow(Context* c, Value* v)
|
|||||||
assert(c, v->next == v);
|
assert(c, v->next == v);
|
||||||
|
|
||||||
Value* next = value(c, v->type);
|
Value* next = value(c, v->type);
|
||||||
|
fprintf(stderr, "grow %p to %p\n", v, next);
|
||||||
v->next = next;
|
v->next = next;
|
||||||
next->next = v;
|
next->next = v;
|
||||||
next->index = 1;
|
next->index = 1;
|
||||||
@ -3558,6 +3563,7 @@ getTarget(Context* c, Value* value, Value* result, const SiteMask& resultMask)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
SingleRead r(resultMask, 0);
|
SingleRead r(resultMask, 0);
|
||||||
|
r.value = result;
|
||||||
s = pickTargetSite(c, &r, true);
|
s = pickTargetSite(c, &r, true);
|
||||||
v = result;
|
v = result;
|
||||||
addSite(c, result, s);
|
addSite(c, result, s);
|
||||||
@ -3627,6 +3633,14 @@ class CombineEvent: public Event {
|
|||||||
|
|
||||||
virtual void compile(Context* c) {
|
virtual void compile(Context* c) {
|
||||||
assert(c, first->source->type(c) == first->next->source->type(c));
|
assert(c, first->source->type(c) == first->next->source->type(c));
|
||||||
|
|
||||||
|
if (second->source->type(c) != second->next->source->type(c)) {
|
||||||
|
fprintf(stderr, "%p %p %d : %p %p %d\n",
|
||||||
|
second, second->source, second->source->type(c),
|
||||||
|
second->next, second->next->source,
|
||||||
|
second->next->source->type(c));
|
||||||
|
}
|
||||||
|
|
||||||
assert(c, second->source->type(c) == second->next->source->type(c));
|
assert(c, second->source->type(c) == second->next->source->type(c));
|
||||||
|
|
||||||
freezeSource(c, firstSize, first);
|
freezeSource(c, firstSize, first);
|
||||||
@ -3823,13 +3837,12 @@ push(Context* c, unsigned footprint, Value* v, bool reverse)
|
|||||||
if (footprint > 1) {
|
if (footprint > 1) {
|
||||||
assert(c, footprint == 2);
|
assert(c, footprint == 2);
|
||||||
|
|
||||||
if (BytesPerWord == 4 and low->next == v) {
|
if (BytesPerWord == 4) {
|
||||||
split(c, low);
|
maybeSplit(c, low);
|
||||||
|
high = pushWord(c, low->next);
|
||||||
|
} else {
|
||||||
|
high = pushWord(c, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
high = pushWord(c, low->next);
|
|
||||||
} else if (v) {
|
|
||||||
high = v->next;
|
|
||||||
} else {
|
} else {
|
||||||
high = 0;
|
high = 0;
|
||||||
}
|
}
|
||||||
@ -3838,7 +3851,7 @@ push(Context* c, unsigned footprint, Value* v, bool reverse)
|
|||||||
v = pushWord(c, v);
|
v = pushWord(c, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (v) {
|
if (high) {
|
||||||
v->next = high;
|
v->next = high;
|
||||||
high->next = v;
|
high->next = v;
|
||||||
high->index = 1;
|
high->index = 1;
|
||||||
@ -3930,7 +3943,7 @@ storeLocal(Context* c, unsigned footprint, Value* v, unsigned index, bool copy)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (BytesPerWord == 4) {
|
if (BytesPerWord == 4) {
|
||||||
assert(c, v->next);
|
assert(c, v->next != v);
|
||||||
|
|
||||||
high = storeLocal(c, 1, v->next, highIndex, false);
|
high = storeLocal(c, 1, v->next, highIndex, false);
|
||||||
} else {
|
} else {
|
||||||
@ -3939,12 +3952,16 @@ storeLocal(Context* c, unsigned footprint, Value* v, unsigned index, bool copy)
|
|||||||
|
|
||||||
index = lowIndex;
|
index = lowIndex;
|
||||||
} else {
|
} else {
|
||||||
high = v->next;
|
high = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
v = maybeBuddy(c, v);
|
v = maybeBuddy(c, v);
|
||||||
v->next = high;
|
|
||||||
high->index = 1;
|
if (high != 0) {
|
||||||
|
v->next = high;
|
||||||
|
high->next = v;
|
||||||
|
high->index = 1;
|
||||||
|
}
|
||||||
|
|
||||||
Local* local = c->locals + index;
|
Local* local = c->locals + index;
|
||||||
local->value = v;
|
local->value = v;
|
||||||
@ -4052,6 +4069,8 @@ class TranslateEvent: public Event {
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual void compile(Context* c) {
|
virtual void compile(Context* c) {
|
||||||
|
assert(c, value->source->type(c) == value->next->source->type(c));
|
||||||
|
|
||||||
uint8_t bTypeMask;
|
uint8_t bTypeMask;
|
||||||
uint64_t bRegisterMask;
|
uint64_t bRegisterMask;
|
||||||
|
|
||||||
@ -4215,7 +4234,7 @@ class MemoryEvent: public Event {
|
|||||||
(c, baseRegister, displacement, indexRegister, scale);
|
(c, baseRegister, displacement, indexRegister, scale);
|
||||||
|
|
||||||
Site* low;
|
Site* low;
|
||||||
if (result->next) {
|
if (result->next != result) {
|
||||||
Site* high = site->copyHigh(c);
|
Site* high = site->copyHigh(c);
|
||||||
low = site->copyLow(c);
|
low = site->copyLow(c);
|
||||||
|
|
||||||
|
28
src/x86.cpp
28
src/x86.cpp
@ -974,13 +974,26 @@ sseMoveRR(Context* c, unsigned aSize, Assembler::Register* a,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
sseMoveCR(Context* c, unsigned aSize, Assembler::Constant* a,
|
||||||
|
unsigned bSize, Assembler::Register* b)
|
||||||
|
{
|
||||||
|
assert(c, aSize <= BytesPerWord);
|
||||||
|
Assembler::Register tmp(c->client->acquireTemporary(GeneralRegisterMask));
|
||||||
|
moveCR2(c, aSize, a, aSize, &tmp, 0);
|
||||||
|
sseMoveRR(c, aSize, &tmp, bSize, b);
|
||||||
|
c->client->releaseTemporary(tmp.low);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
moveCR(Context* c, unsigned aSize, Assembler::Constant* a,
|
moveCR(Context* c, unsigned aSize, Assembler::Constant* a,
|
||||||
unsigned bSize, Assembler::Register* b)
|
unsigned bSize, Assembler::Register* b)
|
||||||
{
|
{
|
||||||
assert(c, not floatReg(b));
|
if (floatReg(b)) {
|
||||||
|
sseMoveCR(c, aSize, a, bSize, b);
|
||||||
moveCR2(c, aSize, a, bSize, b, 0);
|
} else {
|
||||||
|
moveCR2(c, aSize, a, bSize, b, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -2995,8 +3008,7 @@ class MyArchitecture: public Assembler::Architecture {
|
|||||||
// can't move directly from memory to memory
|
// can't move directly from memory to memory
|
||||||
*tmpTypeMask = (1 << RegisterOperand);
|
*tmpTypeMask = (1 << RegisterOperand);
|
||||||
*tmpRegisterMask = GeneralRegisterMask
|
*tmpRegisterMask = GeneralRegisterMask
|
||||||
| (static_cast<uint64_t>(GeneralRegisterMask) << 32)
|
| (static_cast<uint64_t>(GeneralRegisterMask) << 32);
|
||||||
| FloatRegisterMask;
|
|
||||||
} else if (dstTypeMask & (1 << RegisterOperand)) {
|
} else if (dstTypeMask & (1 << RegisterOperand)) {
|
||||||
if (srcTypeMask & (1 << RegisterOperand)) {
|
if (srcTypeMask & (1 << RegisterOperand)) {
|
||||||
if (((dstRegisterMask & FloatRegisterMask) == 0)
|
if (((dstRegisterMask & FloatRegisterMask) == 0)
|
||||||
@ -3023,10 +3035,12 @@ class MyArchitecture: public Assembler::Architecture {
|
|||||||
unsigned, bool* thunk)
|
unsigned, bool* thunk)
|
||||||
{
|
{
|
||||||
*aTypeMask = (1 << RegisterOperand) | (1 << ConstantOperand);
|
*aTypeMask = (1 << RegisterOperand) | (1 << ConstantOperand);
|
||||||
*aRegisterMask = ~static_cast<uint64_t>(0);
|
*aRegisterMask = GeneralRegisterMask
|
||||||
|
| (static_cast<uint64_t>(GeneralRegisterMask) << 32);
|
||||||
|
|
||||||
*bTypeMask = (1 << RegisterOperand);
|
*bTypeMask = (1 << RegisterOperand);
|
||||||
*bRegisterMask = ~static_cast<uint64_t>(0);
|
*bRegisterMask = GeneralRegisterMask
|
||||||
|
| (static_cast<uint64_t>(GeneralRegisterMask) << 32);
|
||||||
|
|
||||||
*thunk = false;
|
*thunk = false;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user