mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 468484 - Minor adjustments to match changes in tamarin, r=gal.
This commit is contained in:
parent
37cfe58e72
commit
ba3dc13800
@ -925,7 +925,7 @@ namespace nanojit
|
|||||||
NanoAssertMsgf(error() || _fpuStkDepth == 0,"_fpuStkDepth %d",_fpuStkDepth);
|
NanoAssertMsgf(error() || _fpuStkDepth == 0,"_fpuStkDepth %d",_fpuStkDepth);
|
||||||
|
|
||||||
internalReset(); // clear the reservation tables and regalloc
|
internalReset(); // clear the reservation tables and regalloc
|
||||||
NanoAssert(!_branchStateMap || _branchStateMap->isEmpty());
|
NanoAssert( !_branchStateMap || _branchStateMap->isEmpty());
|
||||||
_branchStateMap = 0;
|
_branchStateMap = 0;
|
||||||
|
|
||||||
#ifdef AVMPLUS_ARM
|
#ifdef AVMPLUS_ARM
|
||||||
@ -1319,7 +1319,6 @@ namespace nanojit
|
|||||||
NanoAssert(label->addr == 0 && label->regs.isValid());
|
NanoAssert(label->addr == 0 && label->regs.isValid());
|
||||||
//evictRegs(~_allocator.free);
|
//evictRegs(~_allocator.free);
|
||||||
intersectRegisterState(label->regs);
|
intersectRegisterState(label->regs);
|
||||||
//asm_align_code();
|
|
||||||
label->addr = _nIns;
|
label->addr = _nIns;
|
||||||
}
|
}
|
||||||
verbose_only( if (_verbose) { outputAddr=true; asm_output("[%s]", _thisfrag->lirbuf->names->formatRef(ins)); } )
|
verbose_only( if (_verbose) { outputAddr=true; asm_output("[%s]", _thisfrag->lirbuf->names->formatRef(ins)); } )
|
||||||
|
@ -331,7 +331,6 @@ namespace nanojit
|
|||||||
};
|
};
|
||||||
|
|
||||||
// platform specific implementation (see NativeXXX.cpp file)
|
// platform specific implementation (see NativeXXX.cpp file)
|
||||||
void nInit(uint32_t flags);
|
|
||||||
void nInit(AvmCore *);
|
void nInit(AvmCore *);
|
||||||
Register nRegisterAllocFromSet(int32_t set);
|
Register nRegisterAllocFromSet(int32_t set);
|
||||||
void nRegisterResetAll(RegAlloc& a);
|
void nRegisterResetAll(RegAlloc& a);
|
||||||
|
@ -95,7 +95,7 @@ namespace nanojit
|
|||||||
if (start)
|
if (start)
|
||||||
_unused = &start->lir[0];
|
_unused = &start->lir[0];
|
||||||
//buffer_count++;
|
//buffer_count++;
|
||||||
//fprintf(stderr, "LirBuffer %x start %x\n", (int)this, (int)_start);
|
//fprintf(stderr, "LirBuffer %x unused %x\n", (int)this, (int)_unused);
|
||||||
}
|
}
|
||||||
|
|
||||||
LirBuffer::~LirBuffer()
|
LirBuffer::~LirBuffer()
|
||||||
@ -126,6 +126,7 @@ namespace nanojit
|
|||||||
// doesn't include embedded constants nor LIR_skip payload
|
// doesn't include embedded constants nor LIR_skip payload
|
||||||
return _stats.lir;
|
return _stats.lir;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t LirBuffer::byteCount()
|
int32_t LirBuffer::byteCount()
|
||||||
{
|
{
|
||||||
return ((_pages.size() ? _pages.size()-1 : 0) * sizeof(Page)) +
|
return ((_pages.size() ? _pages.size()-1 : 0) * sizeof(Page)) +
|
||||||
@ -138,9 +139,7 @@ namespace nanojit
|
|||||||
if (page)
|
if (page)
|
||||||
_pages.add(page);
|
_pages.add(page);
|
||||||
else
|
else
|
||||||
{
|
|
||||||
_noMem = 1;
|
_noMem = 1;
|
||||||
}
|
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1249,7 +1248,7 @@ namespace nanojit
|
|||||||
#ifdef MEMORY_INFO
|
#ifdef MEMORY_INFO
|
||||||
// m_list.set_meminfo_name("LInsHashSet.list");
|
// m_list.set_meminfo_name("LInsHashSet.list");
|
||||||
#endif
|
#endif
|
||||||
LInsp *list = (LInsp*) gc->Alloc(sizeof(LInsp)*m_cap);
|
LInsp *list = (LInsp*) gc->Alloc(sizeof(LInsp)*m_cap, GC::kZero);
|
||||||
WB(gc, this, &m_list, list);
|
WB(gc, this, &m_list, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1343,7 +1342,7 @@ namespace nanojit
|
|||||||
void FASTCALL LInsHashSet::grow()
|
void FASTCALL LInsHashSet::grow()
|
||||||
{
|
{
|
||||||
const uint32_t newcap = m_cap << 1;
|
const uint32_t newcap = m_cap << 1;
|
||||||
LInsp *newlist = (LInsp*) m_gc->Alloc(newcap * sizeof(LInsp));
|
LInsp *newlist = (LInsp*) m_gc->Alloc(newcap * sizeof(LInsp), GC::kZero);
|
||||||
LInsp *list = m_list;
|
LInsp *list = m_list;
|
||||||
#ifdef MEMORY_INFO
|
#ifdef MEMORY_INFO
|
||||||
// newlist.set_meminfo_name("LInsHashSet.list");
|
// newlist.set_meminfo_name("LInsHashSet.list");
|
||||||
@ -1550,7 +1549,7 @@ namespace nanojit
|
|||||||
}
|
}
|
||||||
void add(LInsp i, LInsp use) {
|
void add(LInsp i, LInsp use) {
|
||||||
if (!i->isconst() && !i->isconstq() && !live.containsKey(i)) {
|
if (!i->isconst() && !i->isconstq() && !live.containsKey(i)) {
|
||||||
NanoAssert(unsigned(i->opcode()) < sizeof(lirNames) / sizeof(lirNames[0]));
|
NanoAssert(size_t(i->opcode()) < sizeof(lirNames) / sizeof(lirNames[0]));
|
||||||
live.put(i,use);
|
live.put(i,use);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1602,7 +1601,7 @@ namespace nanojit
|
|||||||
if (live.contains(i))
|
if (live.contains(i))
|
||||||
{
|
{
|
||||||
live.retire(i,gc);
|
live.retire(i,gc);
|
||||||
NanoAssert(unsigned(i->opcode()) < sizeof(operandCount) / sizeof(operandCount[0]));
|
NanoAssert(size_t(i->opcode()) < sizeof(operandCount) / sizeof(operandCount[0]));
|
||||||
if (i->isStore()) {
|
if (i->isStore()) {
|
||||||
live.add(i->oprnd2(),i); // base
|
live.add(i->oprnd2(),i); // base
|
||||||
live.add(i->oprnd1(),i); // val
|
live.add(i->oprnd1(),i); // val
|
||||||
@ -1742,7 +1741,7 @@ namespace nanojit
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
NanoAssert(unsigned(ref->opcode()) < sizeof(lirNames) / sizeof(lirNames[0]));
|
NanoAssert(size_t(ref->opcode()) < sizeof(lirNames) / sizeof(lirNames[0]));
|
||||||
copyName(ref, lirNames[ref->opcode()], lircounts.add(ref->opcode()));
|
copyName(ref, lirNames[ref->opcode()], lircounts.add(ref->opcode()));
|
||||||
}
|
}
|
||||||
StringNullTerminatedUTF8 cname(gc, names.get(ref)->name);
|
StringNullTerminatedUTF8 cname(gc, names.get(ref)->name);
|
||||||
@ -2165,11 +2164,11 @@ namespace nanojit
|
|||||||
return out->insStorei(v, b, d);
|
return out->insStorei(v, b, d);
|
||||||
}
|
}
|
||||||
|
|
||||||
LInsp LoadFilter::insCall(const CallInfo *call, LInsp args[])
|
LInsp LoadFilter::insCall(const CallInfo *ci, LInsp args[])
|
||||||
{
|
{
|
||||||
if (!call->_cse)
|
if (!ci->_cse)
|
||||||
exprs.clear();
|
exprs.clear();
|
||||||
return out->insCall(call, args);
|
return out->insCall(ci, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
LInsp LoadFilter::ins0(LOpcode op)
|
LInsp LoadFilter::ins0(LOpcode op)
|
||||||
|
@ -246,12 +246,7 @@ namespace nanojit
|
|||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
callInfoWords =
|
callInfoWords = sizeof(LIns*)/sizeof(u_type)
|
||||||
#ifdef NANOJIT_64BIT
|
|
||||||
2
|
|
||||||
#else
|
|
||||||
1
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
uint32_t reference(LIns*) const;
|
uint32_t reference(LIns*) const;
|
||||||
@ -500,7 +495,7 @@ namespace nanojit
|
|||||||
class LirNameMap MMGC_SUBCLASS_DECL
|
class LirNameMap MMGC_SUBCLASS_DECL
|
||||||
{
|
{
|
||||||
template <class Key>
|
template <class Key>
|
||||||
class CountMap : public avmplus::SortedMap<Key, int, avmplus::LIST_NonGCObjects> {
|
class CountMap: public avmplus::SortedMap<Key, int, avmplus::LIST_NonGCObjects> {
|
||||||
public:
|
public:
|
||||||
CountMap(avmplus::GC*gc) : avmplus::SortedMap<Key, int, avmplus::LIST_NonGCObjects>(gc) {}
|
CountMap(avmplus::GC*gc) : avmplus::SortedMap<Key, int, avmplus::LIST_NonGCObjects>(gc) {}
|
||||||
int add(Key k) {
|
int add(Key k) {
|
||||||
@ -588,7 +583,6 @@ namespace nanojit
|
|||||||
return add_flush(out->insBranch(v, condition, to));
|
return add_flush(out->insBranch(v, condition, to));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LIns* ins0(LOpcode v) {
|
LIns* ins0(LOpcode v) {
|
||||||
if (v == LIR_label || v == LIR_start) {
|
if (v == LIR_label || v == LIR_start) {
|
||||||
flush();
|
flush();
|
||||||
@ -714,7 +708,6 @@ namespace nanojit
|
|||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
uint32_t lir; // # instructions
|
uint32_t lir; // # instructions
|
||||||
uint32_t pages; // pages consumed
|
|
||||||
}
|
}
|
||||||
_stats;
|
_stats;
|
||||||
|
|
||||||
@ -783,7 +776,7 @@ namespace nanojit
|
|||||||
public:
|
public:
|
||||||
LirFilter *in;
|
LirFilter *in;
|
||||||
LirFilter(LirFilter *in) : in(in) {}
|
LirFilter(LirFilter *in) : in(in) {}
|
||||||
virtual ~LirFilter() {}
|
virtual ~LirFilter(){}
|
||||||
|
|
||||||
virtual LInsp read() {
|
virtual LInsp read() {
|
||||||
return in->read();
|
return in->read();
|
||||||
|
@ -1108,11 +1108,11 @@ Assembler::asm_prep_fcall(Reservation*, LInsp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
NIns*
|
NIns*
|
||||||
Assembler::asm_branch(bool branchOnFalse, LInsp cond, NIns* targ, bool /*far*/)
|
Assembler::asm_branch(bool branchOnFalse, LInsp cond, NIns* targ, bool far)
|
||||||
{
|
{
|
||||||
// ignore far -- we figure this out on our own.
|
// ignore far -- we figure this out on our own.
|
||||||
// XXX noone actually uses the far param in nj anyway... (always false)
|
// XXX noone actually uses the far param in nj anyway... (always false)
|
||||||
|
(void)far;
|
||||||
|
|
||||||
NIns* at = 0;
|
NIns* at = 0;
|
||||||
LOpcode condop = cond->opcode();
|
LOpcode condop = cond->opcode();
|
||||||
|
@ -93,6 +93,7 @@ namespace nanojit
|
|||||||
|
|
||||||
void Assembler::nInit(AvmCore* core)
|
void Assembler::nInit(AvmCore* core)
|
||||||
{
|
{
|
||||||
|
(void) core;
|
||||||
OSDep::getDate();
|
OSDep::getDate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,7 +121,6 @@ namespace nanojit
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NanoAssert(a != 0);
|
NanoAssert(a != 0);
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
@ -253,10 +253,24 @@ namespace avmplus {
|
|||||||
static GCHeap heap;
|
static GCHeap heap;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static inline void*
|
/**
|
||||||
Alloc(uint32_t bytes)
|
* flags to be passed as second argument to alloc
|
||||||
|
*/
|
||||||
|
enum AllocFlags
|
||||||
{
|
{
|
||||||
|
kZero=1,
|
||||||
|
kContainsPointers=2,
|
||||||
|
kFinalize=4,
|
||||||
|
kRCObject=8
|
||||||
|
};
|
||||||
|
|
||||||
|
static inline void*
|
||||||
|
Alloc(uint32_t bytes, int flags=kZero)
|
||||||
|
{
|
||||||
|
if (flags & kZero)
|
||||||
return calloc(1, bytes);
|
return calloc(1, bytes);
|
||||||
|
else
|
||||||
|
return malloc(bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
|
@ -172,12 +172,12 @@ namespace nanojit
|
|||||||
#define verbose_output if (verbose_enabled()) Assembler::output
|
#define verbose_output if (verbose_enabled()) Assembler::output
|
||||||
#define verbose_outputf if (verbose_enabled()) Assembler::outputf
|
#define verbose_outputf if (verbose_enabled()) Assembler::outputf
|
||||||
#define verbose_enabled() (_verbose)
|
#define verbose_enabled() (_verbose)
|
||||||
#define verbose_only(x) x
|
#define verbose_only(...) __VA_ARGS__
|
||||||
#else
|
#else
|
||||||
#define verbose_output
|
#define verbose_output
|
||||||
#define verbose_outputf
|
#define verbose_outputf
|
||||||
#define verbose_enabled()
|
#define verbose_enabled()
|
||||||
#define verbose_only(x)
|
#define verbose_only(...)
|
||||||
#endif /*NJ_VERBOSE*/
|
#endif /*NJ_VERBOSE*/
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
|
Loading…
Reference in New Issue
Block a user