mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +00:00
sketch new version of x86.cpp to conform to new assembler.h APIs
This commit is contained in:
parent
9654e3445d
commit
9908bbcf50
@ -23,7 +23,6 @@ enum Operation {
|
|||||||
const unsigned OperationCount = Return + 1;
|
const unsigned OperationCount = Return + 1;
|
||||||
|
|
||||||
enum UnaryOperation {
|
enum UnaryOperation {
|
||||||
PushFrame,
|
|
||||||
Call,
|
Call,
|
||||||
LongCall,
|
LongCall,
|
||||||
AlignedCall,
|
AlignedCall,
|
||||||
@ -34,20 +33,20 @@ enum UnaryOperation {
|
|||||||
JumpIfLessOrEqual,
|
JumpIfLessOrEqual,
|
||||||
JumpIfGreaterOrEqual,
|
JumpIfGreaterOrEqual,
|
||||||
JumpIfEqual,
|
JumpIfEqual,
|
||||||
JumpIfNotEqual,
|
JumpIfNotEqual
|
||||||
Negate
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const unsigned UnaryOperationCount = Negate + 1;
|
const unsigned UnaryOperationCount = JumpIfNotEqual + 1;
|
||||||
|
|
||||||
enum BinaryOperation {
|
enum BinaryOperation {
|
||||||
Move,
|
Move,
|
||||||
MoveZ,
|
MoveZ,
|
||||||
Swap,
|
Swap,
|
||||||
Compare
|
Compare,
|
||||||
|
Negate
|
||||||
};
|
};
|
||||||
|
|
||||||
const unsigned BinaryOperationCount = Compare + 1;
|
const unsigned BinaryOperationCount = Negate + 1;
|
||||||
|
|
||||||
enum TernaryOperation {
|
enum TernaryOperation {
|
||||||
LongCompare,
|
LongCompare,
|
||||||
@ -172,7 +171,6 @@ class Assembler {
|
|||||||
virtual unsigned registerCount() = 0;
|
virtual unsigned registerCount() = 0;
|
||||||
|
|
||||||
virtual int stack() = 0;
|
virtual int stack() = 0;
|
||||||
virtual int base() = 0;
|
|
||||||
virtual int thread() = 0;
|
virtual int thread() = 0;
|
||||||
virtual int returnLow() = 0;
|
virtual int returnLow() = 0;
|
||||||
virtual int returnHigh() = 0;
|
virtual int returnHigh() = 0;
|
||||||
@ -241,12 +239,13 @@ class Assembler {
|
|||||||
virtual void dispose() = 0;
|
virtual void dispose() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
Assembler*
|
|
||||||
makeAssembler(System* system, Allocator* allocator, Zone* zone);
|
|
||||||
|
|
||||||
Assembler::Architecture*
|
Assembler::Architecture*
|
||||||
makeArchitecture(System* system);
|
makeArchitecture(System* system);
|
||||||
|
|
||||||
|
Assembler*
|
||||||
|
makeAssembler(System* system, Allocator* allocator, Zone* zone,
|
||||||
|
Assembler::Architecture* architecture);
|
||||||
|
|
||||||
} // namespace vm
|
} // namespace vm
|
||||||
|
|
||||||
#endif//ASSEMBLER_H
|
#endif//ASSEMBLER_H
|
||||||
|
@ -517,7 +517,7 @@ class Context {
|
|||||||
Context(MyThread* t, object method):
|
Context(MyThread* t, object method):
|
||||||
thread(t),
|
thread(t),
|
||||||
zone(t->m->system, t->m->heap, 16 * 1024),
|
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),
|
client(t),
|
||||||
compiler(makeCompiler(t->m->system, assembler, &zone, &client)),
|
compiler(makeCompiler(t->m->system, assembler, &zone, &client)),
|
||||||
method(method),
|
method(method),
|
||||||
@ -533,7 +533,7 @@ class Context {
|
|||||||
Context(MyThread* t):
|
Context(MyThread* t):
|
||||||
thread(t),
|
thread(t),
|
||||||
zone(t->m->system, t->m->heap, LikelyPageSizeInBytes),
|
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),
|
client(t),
|
||||||
compiler(0),
|
compiler(0),
|
||||||
method(0),
|
method(0),
|
||||||
|
@ -16,14 +16,6 @@ using namespace vm;
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
void*
|
|
||||||
allocate(System* s, unsigned size)
|
|
||||||
{
|
|
||||||
void* p = s->tryAllocate(size);
|
|
||||||
if (p == 0) abort();
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char*
|
const char*
|
||||||
append(System* s, const char* a, const char* b,
|
append(System* s, const char* a, const char* b,
|
||||||
const char* c)
|
const char* c)
|
||||||
|
@ -77,14 +77,6 @@ run(void* r)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void*
|
|
||||||
allocate(System* s, unsigned size)
|
|
||||||
{
|
|
||||||
void* p = s->tryAllocate(size);
|
|
||||||
if (p == 0) abort();
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
pathOfExecutable(System* s, const char** retBuf, unsigned* size)
|
pathOfExecutable(System* s, const char** retBuf, unsigned* size)
|
||||||
{
|
{
|
||||||
|
@ -148,6 +148,14 @@ class System {
|
|||||||
virtual void dispose() = 0;
|
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) \
|
#define ACQUIRE_MONITOR(t, m) \
|
||||||
System::MonitorResource MAKE_NAME(monitorResource_) (t, m)
|
System::MonitorResource MAKE_NAME(monitorResource_) (t, m)
|
||||||
|
|
||||||
|
2024
src/x86.cpp
2024
src/x86.cpp
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user