| 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 |
| 64 inline Context* StackHandler::context() const { | 79 inline Context* StackHandler::context() const { |
| 65 const int offset = StackHandlerConstants::kContextOffset; | 80 const int offset = StackHandlerConstants::kContextOffset; |
| 66 return Context::cast(Memory::Object_at(address() + offset)); | 81 return Context::cast(Memory::Object_at(address() + offset)); |
| 67 } | 82 } |
| 68 | 83 |
| 69 | 84 |
| 70 inline int StackHandler::index() const { | 85 inline StackHandler::Kind StackHandler::kind() const { |
| 71 const int offset = StackHandlerConstants::kStateIntOffset; | 86 const int offset = StackHandlerConstants::kStateIntOffset; |
| 72 return Memory::int_at(address() + offset); | 87 return KindField::decode(Memory::unsigned_at(address() + offset)); |
| 73 } | 88 } |
| 74 | 89 |
| 75 | 90 |
| 91 inline unsigned StackHandler::index() const { |
| 92 const int offset = StackHandlerConstants::kStateIntOffset; |
| 93 return IndexField::decode(Memory::unsigned_at(address() + offset)); |
| 94 } |
| 95 |
| 96 |
| 76 inline Object** StackHandler::context_address() const { | 97 inline Object** StackHandler::context_address() const { |
| 77 const int offset = StackHandlerConstants::kContextOffset; | 98 const int offset = StackHandlerConstants::kContextOffset; |
| 78 return reinterpret_cast<Object**>(address() + offset); | 99 return reinterpret_cast<Object**>(address() + offset); |
| 79 } | 100 } |
| 80 | 101 |
| 81 | 102 |
| 82 inline StackFrame::StackFrame(StackFrameIteratorBase* iterator) | 103 inline StackFrame::StackFrame(StackFrameIteratorBase* iterator) |
| 83 : iterator_(iterator), isolate_(iterator_->isolate()) { | 104 : iterator_(iterator), isolate_(iterator_->isolate()) { |
| 84 } | 105 } |
| 85 | 106 |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 inline StackFrame* SafeStackFrameIterator::frame() const { | 326 inline StackFrame* SafeStackFrameIterator::frame() const { |
| 306 DCHECK(!done()); | 327 DCHECK(!done()); |
| 307 DCHECK(frame_->is_java_script() || frame_->is_exit()); | 328 DCHECK(frame_->is_java_script() || frame_->is_exit()); |
| 308 return frame_; | 329 return frame_; |
| 309 } | 330 } |
| 310 | 331 |
| 311 | 332 |
| 312 } } // namespace v8::internal | 333 } } // namespace v8::internal |
| 313 | 334 |
| 314 #endif // V8_FRAMES_INL_H_ | 335 #endif // V8_FRAMES_INL_H_ |
| OLD | NEW |