mirror of
https://github.com/corda/corda.git
synced 2025-01-06 05:04:20 +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;
|
||||
|
||||
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
|
||||
|
@ -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),
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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)
|
||||
|
||||
|
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