| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 inline bool StackHandler::includes(Address address) const { | 47 inline bool StackHandler::includes(Address address) const { |
| 48 Address start = this->address(); | 48 Address start = this->address(); |
| 49 Address end = start + StackHandlerConstants::kSize; | 49 Address end = start + StackHandlerConstants::kSize; |
| 50 return start <= address && address <= end; | 50 return start <= address && address <= end; |
| 51 } | 51 } |
| 52 | 52 |
| 53 | 53 |
| 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 v->VisitPointer(code_address()); | |
| 57 } | 56 } |
| 58 | 57 |
| 59 | 58 |
| 60 inline StackHandler* StackHandler::FromAddress(Address address) { | 59 inline StackHandler* StackHandler::FromAddress(Address address) { |
| 61 return reinterpret_cast<StackHandler*>(address); | 60 return reinterpret_cast<StackHandler*>(address); |
| 62 } | 61 } |
| 63 | 62 |
| 64 | 63 |
| 65 inline bool StackHandler::is_js_entry() const { | 64 inline bool StackHandler::is_js_entry() const { |
| 66 return kind() == JS_ENTRY; | 65 return kind() == JS_ENTRY; |
| 67 } | 66 } |
| 68 | 67 |
| 69 | 68 |
| 70 inline bool StackHandler::is_catch() const { | 69 inline bool StackHandler::is_catch() const { |
| 71 return kind() == CATCH; | 70 return kind() == CATCH; |
| 72 } | 71 } |
| 73 | 72 |
| 74 | 73 |
| 75 inline bool StackHandler::is_finally() const { | 74 inline bool StackHandler::is_finally() const { |
| 76 return kind() == FINALLY; | 75 return kind() == FINALLY; |
| 77 } | 76 } |
| 78 | 77 |
| 79 | 78 |
| 80 inline Context* StackHandler::context() const { | 79 inline Context* StackHandler::context() const { |
| 81 const int offset = StackHandlerConstants::kContextOffset; | 80 const int offset = StackHandlerConstants::kContextOffset; |
| 82 return Context::cast(Memory::Object_at(address() + offset)); | 81 return Context::cast(Memory::Object_at(address() + offset)); |
| 83 } | 82 } |
| 84 | 83 |
| 85 | 84 |
| 86 inline Code* StackHandler::code() const { | |
| 87 const int offset = StackHandlerConstants::kCodeOffset; | |
| 88 return Code::cast(Memory::Object_at(address() + offset)); | |
| 89 } | |
| 90 | |
| 91 | |
| 92 inline StackHandler::Kind StackHandler::kind() const { | 85 inline StackHandler::Kind StackHandler::kind() const { |
| 93 const int offset = StackHandlerConstants::kStateIntOffset; | 86 const int offset = StackHandlerConstants::kStateIntOffset; |
| 94 return KindField::decode(Memory::unsigned_at(address() + offset)); | 87 return KindField::decode(Memory::unsigned_at(address() + offset)); |
| 95 } | 88 } |
| 96 | 89 |
| 97 | 90 |
| 98 inline unsigned StackHandler::index() const { | 91 inline unsigned StackHandler::index() const { |
| 99 const int offset = StackHandlerConstants::kStateIntOffset; | 92 const int offset = StackHandlerConstants::kStateIntOffset; |
| 100 return IndexField::decode(Memory::unsigned_at(address() + offset)); | 93 return IndexField::decode(Memory::unsigned_at(address() + offset)); |
| 101 } | 94 } |
| 102 | 95 |
| 103 | 96 |
| 104 inline Address StackHandler::frame_pointer() const { | 97 inline Address StackHandler::frame_pointer() const { |
| 105 const int offset = StackHandlerConstants::kFPOffset; | 98 const int offset = StackHandlerConstants::kFPOffset; |
| 106 return Memory::Address_at(address() + offset); | 99 return Memory::Address_at(address() + offset); |
| 107 } | 100 } |
| 108 | 101 |
| 109 | 102 |
| 110 inline Object** StackHandler::context_address() const { | 103 inline Object** StackHandler::context_address() const { |
| 111 const int offset = StackHandlerConstants::kContextOffset; | 104 const int offset = StackHandlerConstants::kContextOffset; |
| 112 return reinterpret_cast<Object**>(address() + offset); | 105 return reinterpret_cast<Object**>(address() + offset); |
| 113 } | 106 } |
| 114 | 107 |
| 115 | 108 |
| 116 inline Object** StackHandler::code_address() const { | |
| 117 const int offset = StackHandlerConstants::kCodeOffset; | |
| 118 return reinterpret_cast<Object**>(address() + offset); | |
| 119 } | |
| 120 | |
| 121 | |
| 122 inline StackFrame::StackFrame(StackFrameIteratorBase* iterator) | 109 inline StackFrame::StackFrame(StackFrameIteratorBase* iterator) |
| 123 : iterator_(iterator), isolate_(iterator_->isolate()) { | 110 : iterator_(iterator), isolate_(iterator_->isolate()) { |
| 124 } | 111 } |
| 125 | 112 |
| 126 | 113 |
| 127 inline StackHandler* StackFrame::top_handler() const { | 114 inline StackHandler* StackFrame::top_handler() const { |
| 128 return iterator_->handler(); | 115 return iterator_->handler(); |
| 129 } | 116 } |
| 130 | 117 |
| 131 | 118 |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 inline StackFrame* SafeStackFrameIterator::frame() const { | 332 inline StackFrame* SafeStackFrameIterator::frame() const { |
| 346 DCHECK(!done()); | 333 DCHECK(!done()); |
| 347 DCHECK(frame_->is_java_script() || frame_->is_exit()); | 334 DCHECK(frame_->is_java_script() || frame_->is_exit()); |
| 348 return frame_; | 335 return frame_; |
| 349 } | 336 } |
| 350 | 337 |
| 351 | 338 |
| 352 } } // namespace v8::internal | 339 } } // namespace v8::internal |
| 353 | 340 |
| 354 #endif // V8_FRAMES_INL_H_ | 341 #endif // V8_FRAMES_INL_H_ |
| OLD | NEW |