sketch new version of x86.cpp to conform to new assembler.h APIs

This commit is contained in:
Joel Dice 2008-08-19 17:38:37 -06:00
parent 9654e3445d
commit 9908bbcf50
6 changed files with 224 additions and 1847 deletions

View File

@ -23,7 +23,6 @@ enum Operation {
const unsigned OperationCount = Return + 1;
enum UnaryOperation {
PushFrame,
Call,
LongCall,
AlignedCall,
@ -34,20 +33,20 @@ enum UnaryOperation {
JumpIfLessOrEqual,
JumpIfGreaterOrEqual,
JumpIfEqual,
JumpIfNotEqual,
Negate
JumpIfNotEqual
};
const unsigned UnaryOperationCount = Negate + 1;
const unsigned UnaryOperationCount = JumpIfNotEqual + 1;
enum BinaryOperation {
Move,
MoveZ,
Swap,
Compare
Compare,
Negate
};
const unsigned BinaryOperationCount = Compare + 1;
const unsigned BinaryOperationCount = Negate + 1;
enum TernaryOperation {
LongCompare,
@ -172,7 +171,6 @@ class Assembler {
virtual unsigned registerCount() = 0;
virtual int stack() = 0;
virtual int base() = 0;
virtual int thread() = 0;
virtual int returnLow() = 0;
virtual int returnHigh() = 0;
@ -241,12 +239,13 @@ class Assembler {
virtual void dispose() = 0;
};
Assembler*
makeAssembler(System* system, Allocator* allocator, Zone* zone);
Assembler::Architecture*
makeArchitecture(System* system);
Assembler*
makeAssembler(System* system, Allocator* allocator, Zone* zone,
Assembler::Architecture* architecture);
} // namespace vm
#endif//ASSEMBLER_H

View File

@ -517,7 +517,7 @@ class Context {
Context(MyThread* t, object method):
thread(t),
zone(t->m->system, t->m->heap, 16 * 1024),
assembler(makeAssembler(t->m->system, t->m->heap, &zone)),
assembler(makeAssembler(t->m->system, t->m->heap, &zone, t->arch)),
client(t),
compiler(makeCompiler(t->m->system, assembler, &zone, &client)),
method(method),
@ -533,7 +533,7 @@ class Context {
Context(MyThread* t):
thread(t),
zone(t->m->system, t->m->heap, LikelyPageSizeInBytes),
assembler(makeAssembler(t->m->system, t->m->heap, &zone)),
assembler(makeAssembler(t->m->system, t->m->heap, &zone, t->arch)),
client(t),
compiler(0),
method(0),

View File

@ -16,14 +16,6 @@ using namespace vm;
namespace {
void*
allocate(System* s, unsigned size)
{
void* p = s->tryAllocate(size);
if (p == 0) abort();
return p;
}
const char*
append(System* s, const char* a, const char* b,
const char* c)

View File

@ -77,14 +77,6 @@ run(void* r)
return 0;
}
void*
allocate(System* s, unsigned size)
{
void* p = s->tryAllocate(size);
if (p == 0) abort();
return p;
}
void
pathOfExecutable(System* s, const char** retBuf, unsigned* size)
{

View File

@ -148,6 +148,14 @@ class System {
virtual void dispose() = 0;
};
inline void*
allocate(System* s, unsigned size)
{
void* p = s->tryAllocate(size);
if (p == 0) s->abort();
return p;
}
#define ACQUIRE_MONITOR(t, m) \
System::MonitorResource MAKE_NAME(monitorResource_) (t, m)

File diff suppressed because it is too large Load Diff