| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 return reinterpret_cast<Address>(const_cast<StackHandler*>(this)); | 52 return reinterpret_cast<Address>(const_cast<StackHandler*>(this)); |
| 53 } | 53 } |
| 54 | 54 |
| 55 | 55 |
| 56 inline StackHandler* StackHandler::next() const { | 56 inline StackHandler* StackHandler::next() const { |
| 57 const int offset = StackHandlerConstants::kNextOffset; | 57 const int offset = StackHandlerConstants::kNextOffset; |
| 58 return FromAddress(Memory::Address_at(address() + offset)); | 58 return FromAddress(Memory::Address_at(address() + offset)); |
| 59 } | 59 } |
| 60 | 60 |
| 61 | 61 |
| 62 inline Code* StackHandler::code() const { |
| 63 return Code::cast(*code_address()); |
| 64 } |
| 65 |
| 66 |
| 67 inline int StackHandler::index() const { |
| 68 const int offset = StackHandlerConstants::kStateOffset; |
| 69 return IndexField::decode(Memory::unsigned_at(address() + offset)); |
| 70 } |
| 71 |
| 72 |
| 62 inline bool StackHandler::includes(Address address) const { | 73 inline bool StackHandler::includes(Address address) const { |
| 63 Address start = this->address(); | 74 Address start = this->address(); |
| 64 Address end = start + StackHandlerConstants::kSize; | 75 Address end = start + StackHandlerConstants::kSize; |
| 65 return start <= address && address <= end; | 76 return start <= address && address <= end; |
| 66 } | 77 } |
| 67 | 78 |
| 68 | 79 |
| 69 inline void StackHandler::Iterate(ObjectVisitor* v, Code* holder) const { | 80 inline void StackHandler::Iterate(ObjectVisitor* v, Code* holder) const { |
| 70 v->VisitPointer(context_address()); | 81 v->VisitPointer(context_address()); |
| 71 v->VisitPointer(code_address()); | 82 v->VisitPointer(code_address()); |
| 72 } | 83 } |
| 73 | 84 |
| 74 | 85 |
| 75 inline StackHandler* StackHandler::FromAddress(Address address) { | 86 inline StackHandler* StackHandler::FromAddress(Address address) { |
| 76 return reinterpret_cast<StackHandler*>(address); | 87 return reinterpret_cast<StackHandler*>(address); |
| 77 } | 88 } |
| 78 | 89 |
| 79 | 90 |
| 80 inline bool StackHandler::is_js_entry() const { | 91 inline bool StackHandler::is_js_entry() const { |
| 81 return kind() == JS_ENTRY; | 92 return kind() == JS_ENTRY; |
| 82 } | 93 } |
| 83 | 94 |
| 84 | 95 |
| 85 inline bool StackHandler::is_catch() const { | 96 inline bool StackHandler::is_catch() const { |
| 86 return kind() == CATCH; | 97 return kind() == CATCH || kind() == OPTIMIZED_CATCH; |
| 87 } | 98 } |
| 88 | 99 |
| 89 | 100 |
| 90 inline bool StackHandler::is_finally() const { | 101 inline bool StackHandler::is_finally() const { |
| 91 return kind() == FINALLY; | 102 return kind() == FINALLY; |
| 92 } | 103 } |
| 93 | 104 |
| 94 | 105 |
| 106 inline bool StackHandler::is_optimized() const { |
| 107 return (kind() & kIsOptimizedMask) != 0; |
| 108 } |
| 109 |
| 110 |
| 95 inline StackHandler::Kind StackHandler::kind() const { | 111 inline StackHandler::Kind StackHandler::kind() const { |
| 96 const int offset = StackHandlerConstants::kStateOffset; | 112 const int offset = StackHandlerConstants::kStateOffset; |
| 97 return KindField::decode(Memory::unsigned_at(address() + offset)); | 113 return KindField::decode(Memory::unsigned_at(address() + offset)); |
| 98 } | 114 } |
| 99 | 115 |
| 100 | 116 |
| 101 inline Object** StackHandler::context_address() const { | 117 inline Object** StackHandler::context_address() const { |
| 102 const int offset = StackHandlerConstants::kContextOffset; | 118 const int offset = StackHandlerConstants::kContextOffset; |
| 103 return reinterpret_cast<Object**>(address() + offset); | 119 return reinterpret_cast<Object**>(address() + offset); |
| 104 } | 120 } |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 template<typename Iterator> | 335 template<typename Iterator> |
| 320 void JavaScriptFrameIteratorTemp<Iterator>::Reset() { | 336 void JavaScriptFrameIteratorTemp<Iterator>::Reset() { |
| 321 iterator_.Reset(); | 337 iterator_.Reset(); |
| 322 if (!done()) Advance(); | 338 if (!done()) Advance(); |
| 323 } | 339 } |
| 324 | 340 |
| 325 | 341 |
| 326 } } // namespace v8::internal | 342 } } // namespace v8::internal |
| 327 | 343 |
| 328 #endif // V8_FRAMES_INL_H_ | 344 #endif // V8_FRAMES_INL_H_ |
| OLD | NEW |