OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_FRAMES_INL_H_ | 5 #ifndef V8_FRAMES_INL_H_ |
6 #define V8_FRAMES_INL_H_ | 6 #define V8_FRAMES_INL_H_ |
7 | 7 |
8 #include "src/frames.h" | 8 #include "src/frames.h" |
9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
10 #include "src/v8memory.h" | 10 #include "src/v8memory.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 inline void StackHandler::Iterate(ObjectVisitor* v, Code* holder) const { | 54 inline void StackHandler::Iterate(ObjectVisitor* v, Code* holder) const { |
55 v->VisitPointer(context_address()); | 55 v->VisitPointer(context_address()); |
56 } | 56 } |
57 | 57 |
58 | 58 |
59 inline StackHandler* StackHandler::FromAddress(Address address) { | 59 inline StackHandler* StackHandler::FromAddress(Address address) { |
60 return reinterpret_cast<StackHandler*>(address); | 60 return reinterpret_cast<StackHandler*>(address); |
61 } | 61 } |
62 | 62 |
63 | 63 |
64 inline bool StackHandler::is_js_entry() const { | |
65 return kind() == JS_ENTRY; | |
66 } | |
67 | |
68 | |
69 inline bool StackHandler::is_catch() const { | |
70 return kind() == CATCH; | |
71 } | |
72 | |
73 | |
74 inline bool StackHandler::is_finally() const { | |
75 return kind() == FINALLY; | |
76 } | |
77 | |
78 | |
79 inline Context* StackHandler::context() const { | 64 inline Context* StackHandler::context() const { |
80 const int offset = StackHandlerConstants::kContextOffset; | 65 const int offset = StackHandlerConstants::kContextOffset; |
81 return Context::cast(Memory::Object_at(address() + offset)); | 66 return Context::cast(Memory::Object_at(address() + offset)); |
82 } | 67 } |
83 | 68 |
84 | 69 |
85 inline StackHandler::Kind StackHandler::kind() const { | 70 inline int StackHandler::index() const { |
86 const int offset = StackHandlerConstants::kStateIntOffset; | 71 const int offset = StackHandlerConstants::kStateIntOffset; |
87 return KindField::decode(Memory::unsigned_at(address() + offset)); | 72 return Memory::int_at(address() + offset); |
88 } | 73 } |
89 | 74 |
90 | 75 |
91 inline unsigned StackHandler::index() const { | |
92 const int offset = StackHandlerConstants::kStateIntOffset; | |
93 return IndexField::decode(Memory::unsigned_at(address() + offset)); | |
94 } | |
95 | |
96 | |
97 inline Object** StackHandler::context_address() const { | 76 inline Object** StackHandler::context_address() const { |
98 const int offset = StackHandlerConstants::kContextOffset; | 77 const int offset = StackHandlerConstants::kContextOffset; |
99 return reinterpret_cast<Object**>(address() + offset); | 78 return reinterpret_cast<Object**>(address() + offset); |
100 } | 79 } |
101 | 80 |
102 | 81 |
103 inline StackFrame::StackFrame(StackFrameIteratorBase* iterator) | 82 inline StackFrame::StackFrame(StackFrameIteratorBase* iterator) |
104 : iterator_(iterator), isolate_(iterator_->isolate()) { | 83 : iterator_(iterator), isolate_(iterator_->isolate()) { |
105 } | 84 } |
106 | 85 |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 inline StackFrame* SafeStackFrameIterator::frame() const { | 305 inline StackFrame* SafeStackFrameIterator::frame() const { |
327 DCHECK(!done()); | 306 DCHECK(!done()); |
328 DCHECK(frame_->is_java_script() || frame_->is_exit()); | 307 DCHECK(frame_->is_java_script() || frame_->is_exit()); |
329 return frame_; | 308 return frame_; |
330 } | 309 } |
331 | 310 |
332 | 311 |
333 } } // namespace v8::internal | 312 } } // namespace v8::internal |
334 | 313 |
335 #endif // V8_FRAMES_INL_H_ | 314 #endif // V8_FRAMES_INL_H_ |
OLD | NEW |