From e68a18248cef9293e836065241d1d377e0e12dfd Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Sat, 31 May 2008 16:24:04 -0600 Subject: [PATCH] use codePromise helper function in CallEvent ctor --- src/compiler.cpp | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/compiler.cpp b/src/compiler.cpp index c941ba377c..a6f6cbe6c1 100644 --- a/src/compiler.cpp +++ b/src/compiler.cpp @@ -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,