move FrameSiteEvent out of compiler.cpp

This commit is contained in:
Joshua Warner 2013-02-13 21:52:07 -07:00
parent be86d26512
commit 94ddb62b5f
3 changed files with 30 additions and 26 deletions

View File

@ -1414,32 +1414,6 @@ register_(Context* c, int number)
return value(c, type, s, s);
}
class FrameSiteEvent: public Event {
public:
FrameSiteEvent(Context* c, Value* value, int index):
Event(c), value(value), index(index)
{ }
virtual const char* name() {
return "FrameSiteEvent";
}
virtual void compile(Context* c) {
if (live(c, value)) {
value->addSite(c, frameSite(c, index));
}
}
Value* value;
int index;
};
void
appendFrameSite(Context* c, Value* value, int index)
{
append(c, new(c->zone) FrameSiteEvent(c, value, index));
}
unsigned
frameFootprint(Context* c, Stack* s)
{

View File

@ -1578,6 +1578,33 @@ appendBoundsCheck(Context* c, Value* object, unsigned lengthOffset,
append(c, new(c->zone) BoundsCheckEvent(c, object, lengthOffset, index, handler));
}
class FrameSiteEvent: public Event {
public:
FrameSiteEvent(Context* c, Value* value, int index):
Event(c), value(value), index(index)
{ }
virtual const char* name() {
return "FrameSiteEvent";
}
virtual void compile(Context* c) {
if (live(c, value)) {
value->addSite(c, frameSite(c, index));
}
}
Value* value;
int index;
};
void
appendFrameSite(Context* c, Value* value, int index)
{
append(c, new(c->zone) FrameSiteEvent(c, value, index));
}
} // namespace compiler
} // namespace codegen
} // namespace avian

View File

@ -151,6 +151,9 @@ void
appendBoundsCheck(Context* c, Value* object, unsigned lengthOffset,
Value* index, intptr_t handler);
void
appendFrameSite(Context* c, Value* value, int index);
} // namespace compiler
} // namespace codegen
} // namespace avian