use codePromise helper function in CallEvent ctor

This commit is contained in:
Joel Dice 2008-05-31 16:24:04 -06:00
parent 65830a76c5
commit e68a18248c

View File

@ -1342,6 +1342,19 @@ resetLocals(Context* c)
c->locals = 0;
}
CodePromise*
codePromise(Context* c, Event* e)
{
return e->promises = new (c->zone->allocate(sizeof(CodePromise)))
CodePromise(c, e->promises);
}
CodePromise*
codePromise(Context* c, int offset)
{
return new (c->zone->allocate(sizeof(CodePromise))) CodePromise(c, offset);
}
class CallEvent: public Event {
public:
CallEvent(Context* c, Value* address, unsigned flags,
@ -1397,9 +1410,7 @@ class CallEvent: public Event {
apply(c, type, BytesPerWord, address->source);
if (traceHandler) {
traceHandler->handleTrace
(new (c->zone->allocate(sizeof(CodePromise)))
CodePromise(c, c->assembler->length()));
traceHandler->handleTrace(codePromise(c, c->assembler->length()));
}
cleanStack(c, stack, locals, reads);
@ -2175,19 +2186,6 @@ appendLocal(Context* c, unsigned size, Local* local)
new (c->zone->allocate(sizeof(LocalEvent))) LocalEvent(c, size, local);
}
CodePromise*
codePromise(Context* c, Event* e)
{
return e->promises = new (c->zone->allocate(sizeof(CodePromise)))
CodePromise(c, e->promises);
}
CodePromise*
codePromise(Context* c, int offset)
{
return new (c->zone->allocate(sizeof(CodePromise))) CodePromise(c, offset);
}
class BoundsCheckEvent: public Event {
public:
BoundsCheckEvent(Context* c, Value* object, unsigned lengthOffset,