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 26 matching lines...) Expand all Loading... |
37 return reinterpret_cast<Address>(const_cast<StackHandler*>(this)); | 37 return reinterpret_cast<Address>(const_cast<StackHandler*>(this)); |
38 } | 38 } |
39 | 39 |
40 | 40 |
41 inline StackHandler* StackHandler::next() const { | 41 inline StackHandler* StackHandler::next() const { |
42 const int offset = StackHandlerConstants::kNextOffset; | 42 const int offset = StackHandlerConstants::kNextOffset; |
43 return FromAddress(Memory::Address_at(address() + offset)); | 43 return FromAddress(Memory::Address_at(address() + offset)); |
44 } | 44 } |
45 | 45 |
46 | 46 |
47 inline bool StackHandler::includes(Address address) const { | |
48 Address start = this->address(); | |
49 Address end = start + StackHandlerConstants::kSize; | |
50 return start <= address && address <= end; | |
51 } | |
52 | |
53 | |
54 inline void StackHandler::Iterate(ObjectVisitor* v, Code* holder) const { | |
55 v->VisitPointer(context_address()); | |
56 } | |
57 | |
58 | |
59 inline StackHandler* StackHandler::FromAddress(Address address) { | 47 inline StackHandler* StackHandler::FromAddress(Address address) { |
60 return reinterpret_cast<StackHandler*>(address); | 48 return reinterpret_cast<StackHandler*>(address); |
61 } | 49 } |
62 | 50 |
63 | 51 |
64 inline Context* StackHandler::context() const { | |
65 const int offset = StackHandlerConstants::kContextOffset; | |
66 return Context::cast(Memory::Object_at(address() + offset)); | |
67 } | |
68 | |
69 | |
70 inline int StackHandler::index() const { | |
71 const int offset = StackHandlerConstants::kStateIntOffset; | |
72 return Memory::int_at(address() + offset); | |
73 } | |
74 | |
75 | |
76 inline Object** StackHandler::context_address() const { | |
77 const int offset = StackHandlerConstants::kContextOffset; | |
78 return reinterpret_cast<Object**>(address() + offset); | |
79 } | |
80 | |
81 | |
82 inline StackFrame::StackFrame(StackFrameIteratorBase* iterator) | 52 inline StackFrame::StackFrame(StackFrameIteratorBase* iterator) |
83 : iterator_(iterator), isolate_(iterator_->isolate()) { | 53 : iterator_(iterator), isolate_(iterator_->isolate()) { |
84 } | 54 } |
85 | 55 |
86 | 56 |
87 inline StackHandler* StackFrame::top_handler() const { | 57 inline StackHandler* StackFrame::top_handler() const { |
88 return iterator_->handler(); | 58 return iterator_->handler(); |
89 } | 59 } |
90 | 60 |
91 | 61 |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 inline StackFrame* SafeStackFrameIterator::frame() const { | 275 inline StackFrame* SafeStackFrameIterator::frame() const { |
306 DCHECK(!done()); | 276 DCHECK(!done()); |
307 DCHECK(frame_->is_java_script() || frame_->is_exit()); | 277 DCHECK(frame_->is_java_script() || frame_->is_exit()); |
308 return frame_; | 278 return frame_; |
309 } | 279 } |
310 | 280 |
311 | 281 |
312 } } // namespace v8::internal | 282 } } // namespace v8::internal |
313 | 283 |
314 #endif // V8_FRAMES_INL_H_ | 284 #endif // V8_FRAMES_INL_H_ |
OLD | NEW |