rename x86 Offset for consistency with arm and powerpc OffsetPromise

This commit is contained in:
Joshua Warner 2013-02-24 20:48:06 -07:00
parent d2caf50772
commit 82eec28856
2 changed files with 15 additions and 16 deletions

View File

@ -33,15 +33,15 @@ ResolvedPromise* resolvedPromise(Context* c, int64_t value) {
return new(c->zone) ResolvedPromise(value);
}
Offset::Offset(Context* c, MyBlock* block, unsigned offset, AlignmentPadding* limit):
OffsetPromise::OffsetPromise(Context* c, MyBlock* block, unsigned offset, AlignmentPadding* limit):
c(c), block(block), offset(offset), limit(limit), value_(-1)
{ }
bool Offset::resolved() {
bool OffsetPromise::resolved() {
return block->start != static_cast<unsigned>(~0);
}
int64_t Offset::value() {
int64_t OffsetPromise::value() {
assert(c, resolved());
if (value_ == -1) {
@ -52,7 +52,7 @@ int64_t Offset::value() {
return value_;
}
Promise* offsetPromise(Context* c) {
return new(c->zone) Offset(c, c->lastBlock, c->code.length(), c->lastBlock->lastPadding);
return new(c->zone) OffsetPromise(c, c->lastBlock, c->code.length(), c->lastBlock->lastPadding);
}
void*

View File

@ -29,9 +29,18 @@ class AlignmentPadding;
ResolvedPromise* resolvedPromise(Context* c, int64_t value);
class Offset: public Promise {
class Task {
public:
Offset(Context* c, MyBlock* block, unsigned offset, AlignmentPadding* limit);
Task(Task* next): next(next) { }
virtual void run(Context* c) = 0;
Task* next;
};
class OffsetPromise: public Promise {
public:
OffsetPromise(Context* c, MyBlock* block, unsigned offset, AlignmentPadding* limit);
virtual bool resolved();
@ -46,16 +55,6 @@ class Offset: public Promise {
Promise* offsetPromise(Context* c);
class Task {
public:
Task(Task* next): next(next) { }
virtual void run(Context* c) = 0;
Task* next;
};
void* resolveOffset(vm::System* s, uint8_t* instruction, unsigned instructionSize, int64_t value);
class OffsetListener: public Promise::Listener {