diff -r b40b0e18a918 -r dfce0539a77d jitcraft/Stack.h --- a/jitcraft/Stack.h Tue Jul 10 02:11:13 2012 -0700 +++ b/jitcraft/Stack.h Wed Jul 11 01:12:54 2012 -0700 @@ -32,6 +32,7 @@ class Reference; class Frame; class Stack; +class Zone; union LocalSlot { @@ -99,6 +100,10 @@ bool isNative() const { return callee_ && callee_->is(MapKind_Native); } + Native *native() const { + assert(isNative()); + return native_; + } Code *code() const { assert(code_); return code_; @@ -175,7 +180,7 @@ static const size_t STACK_SIZE = 1024 * 1024; public: - Stack(); + Stack(Zone *zone); ~Stack(); bool initialize(); @@ -198,11 +203,27 @@ void popNativeFrame(NativeArgs &args); private: + Zone *zone_; char *buffer_; char *end_; Top top_; }; +class StackIter +{ + bytecode *pc_; + Frame *fp_; + + public: + StackIter(Zone *zone); + + bool done() const; + const char *function() const; + unsigned lineNumber() const; + const char *source() const; + void prev(); +}; + } #endif // _include_jc_stack_h_