28 #ifndef V8_FRAMES_INL_H_
29 #define V8_FRAMES_INL_H_
35 #if V8_TARGET_ARCH_IA32
37 #elif V8_TARGET_ARCH_X64
39 #elif V8_TARGET_ARCH_ARM
41 #elif V8_TARGET_ARCH_MIPS
44 #error Unsupported target architecture.
51 inline Address StackHandler::address()
const {
52 return reinterpret_cast<Address>(
const_cast<StackHandler*
>(
this));
56 inline StackHandler* StackHandler::next()
const {
62 inline bool StackHandler::includes(
Address address)
const {
63 Address start = this->address();
65 return start <= address && address <= end;
69 inline void StackHandler::Iterate(ObjectVisitor* v, Code* holder)
const {
70 v->VisitPointer(context_address());
71 v->VisitPointer(code_address());
75 inline StackHandler* StackHandler::FromAddress(
Address address) {
76 return reinterpret_cast<StackHandler*
>(address);
80 inline bool StackHandler::is_js_entry()
const {
81 return kind() == JS_ENTRY;
85 inline bool StackHandler::is_catch()
const {
86 return kind() == CATCH;
90 inline bool StackHandler::is_finally()
const {
91 return kind() == FINALLY;
95 inline StackHandler::Kind StackHandler::kind()
const {
101 inline Object** StackHandler::context_address()
const {
103 return reinterpret_cast<Object**
>(address() + offset);
107 inline Object** StackHandler::code_address()
const {
109 return reinterpret_cast<Object**
>(address() + offset);
114 : iterator_(iterator), isolate_(iterator_->isolate()) {
118 inline StackHandler* StackFrame::top_handler()
const {
119 return iterator_->handler();
123 inline Code* StackFrame::LookupCode()
const {
124 return GetContainingCode(isolate(),
pc());
128 inline Code* StackFrame::GetContainingCode(Isolate* isolate,
Address pc) {
129 return isolate->inner_pointer_to_code_cache()->GetCacheEntry(pc)->code;
205 ASSERT(-1 <= index && index < param_count);
206 int parameter_offset = (param_count - index - 1) *
kPointerSize;
207 return caller_sp() + parameter_offset;
232 Object* result = function_slot_object();
233 ASSERT(result->IsJSFunction());
258 template<
typename Iterator>
259 inline JavaScriptFrameIteratorTemp<Iterator>::JavaScriptFrameIteratorTemp(
261 : iterator_(isolate) {
262 if (!done()) Advance();
266 template<
typename Iterator>
267 inline JavaScriptFrameIteratorTemp<Iterator>::JavaScriptFrameIteratorTemp(
268 Isolate* isolate, ThreadLocalTop* top)
269 : iterator_(isolate, top) {
270 if (!done()) Advance();
274 template<
typename Iterator>
275 inline JavaScriptFrame* JavaScriptFrameIteratorTemp<Iterator>::frame()
const {
281 ASSERT(frame->is_java_script() || frame->is_arguments_adaptor());
282 return static_cast<JavaScriptFrame*
>(frame);
286 template<
typename Iterator>
287 JavaScriptFrameIteratorTemp<Iterator>::JavaScriptFrameIteratorTemp(
288 Isolate* isolate, StackFrame::Id
id)
289 : iterator_(isolate) {
294 template<
typename Iterator>
295 void JavaScriptFrameIteratorTemp<Iterator>::Advance() {
298 }
while (!iterator_.done() && !iterator_.frame()->is_java_script());
302 template<
typename Iterator>
303 void JavaScriptFrameIteratorTemp<Iterator>::AdvanceToArgumentsFrame() {
304 if (!frame()->has_adapted_arguments())
return;
306 ASSERT(iterator_.frame()->is_arguments_adaptor());
310 template<
typename Iterator>
311 void JavaScriptFrameIteratorTemp<Iterator>::AdvanceToId(StackFrame::Id
id) {
314 if (frame()->
id() ==
id)
return;
319 template<
typename Iterator>
320 void JavaScriptFrameIteratorTemp<Iterator>::Reset() {
322 if (!done()) Advance();
328 #endif // V8_FRAMES_INL_H_
static const int kCallerFPOffset
Object * function() const
static Object *& Object_at(Address addr)
static Smi * FromInt(int value)
Address GetParameterSlot(int index) const
static const int kStateOffset
static bool IsArgumentsAdaptorFrame(Address fp)
Address GetExpressionAddress(int n) const
Address caller_fp() const
Object * GetExpression(int index) const
#define ASSERT(condition)
ArgumentsAdaptorFrame(StackFrameIterator *iterator)
int ComputeParametersCount() const
Object * receiver() const
HANDLE HANDLE LPSTACKFRAME64 StackFrame
static Address ComputePCAddress(Address fp)
static const int kNextOffset
void SetExpression(int index, Object *value)
static Address & Address_at(Address addr)
static const int kContextOffset
void set_receiver(Object *value)
Address caller_pc() const
EntryConstructFrame(StackFrameIterator *iterator)
EntryFrame(StackFrameIterator *iterator)
OptimizedFrame(StackFrameIterator *iterator)
ConstructFrame(StackFrameIterator *iterator)
static const int kContextOffset
JavaScriptFrame(StackFrameIterator *iterator)
static const int kCallerPCOffset
InternalFrame(StackFrameIterator *iterator)
static bool IsConstructFrame(Address fp)
static unsigned & unsigned_at(Address addr)
ExitFrame(StackFrameIterator *iterator)
static const int kCodeOffset
StandardFrame(StackFrameIterator *iterator)
static const int kMarkerOffset
Object * GetParameter(int index) const
bool has_adapted_arguments() const