| 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 |
| 62 inline bool StackHandler::includes(Address address) const { | 67 inline bool StackHandler::includes(Address address) const { |
| 63 Address start = this->address(); | 68 Address start = this->address(); |
| 64 Address end = start + StackHandlerConstants::kSize; | 69 Address end = start + StackHandlerConstants::kSize; |
| 65 return start <= address && address <= end; | 70 return start <= address && address <= end; |
| 66 } | 71 } |
| 67 | 72 |
| 68 | 73 |
| 69 inline void StackHandler::Iterate(ObjectVisitor* v, Code* holder) const { | 74 inline void StackHandler::Iterate(ObjectVisitor* v, Code* holder) const { |
| 70 v->VisitPointer(context_address()); | 75 v->VisitPointer(context_address()); |
| 71 v->VisitPointer(code_address()); | 76 v->VisitPointer(code_address()); |
| 72 } | 77 } |
| 73 | 78 |
| 74 | 79 |
| 75 inline StackHandler* StackHandler::FromAddress(Address address) { | 80 inline StackHandler* StackHandler::FromAddress(Address address) { |
| 76 return reinterpret_cast<StackHandler*>(address); | 81 return reinterpret_cast<StackHandler*>(address); |
| 77 } | 82 } |
| 78 | 83 |
| 79 | 84 |
| 80 inline bool StackHandler::is_js_entry() const { | 85 inline bool StackHandler::is_js_entry() const { |
| 81 return kind() == JS_ENTRY; | 86 return kind() == JS_ENTRY; |
| 82 } | 87 } |
| 83 | 88 |
| 84 | 89 |
| 85 inline bool StackHandler::is_catch() const { | 90 inline bool StackHandler::is_catch() const { |
| 86 return kind() == CATCH; | 91 return kind() == CATCH || kind() == OPTIMIZED_CATCH; |
| 87 } | 92 } |
| 88 | 93 |
| 89 | 94 |
| 90 inline bool StackHandler::is_finally() const { | 95 inline bool StackHandler::is_finally() const { |
| 91 return kind() == FINALLY; | 96 return kind() == FINALLY; |
| 92 } | 97 } |
| 93 | 98 |
| 94 | 99 |
| 100 inline bool StackHandler::is_optimized() const { |
| 101 return (kind() & kIsOptimizedMask) != 0; |
| 102 } |
| 103 |
| 104 |
| 95 inline StackHandler::Kind StackHandler::kind() const { | 105 inline StackHandler::Kind StackHandler::kind() const { |
| 96 const int offset = StackHandlerConstants::kStateOffset; | 106 const int offset = StackHandlerConstants::kStateOffset; |
| 97 return KindField::decode(Memory::unsigned_at(address() + offset)); | 107 return KindField::decode(Memory::unsigned_at(address() + offset)); |
| 98 } | 108 } |
| 99 | 109 |
| 100 | 110 |
| 101 inline unsigned StackHandler::index() const { | 111 inline unsigned StackHandler::index() const { |
| 102 const int offset = StackHandlerConstants::kStateOffset; | 112 const int offset = StackHandlerConstants::kStateOffset; |
| 103 return IndexField::decode(Memory::unsigned_at(address() + offset)); | 113 return IndexField::decode(Memory::unsigned_at(address() + offset)); |
| 104 } | 114 } |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 // adaptor frames. | 341 // adaptor frames. |
| 332 StackFrame* frame = iterator_.frame(); | 342 StackFrame* frame = iterator_.frame(); |
| 333 ASSERT(frame->is_java_script()); | 343 ASSERT(frame->is_java_script()); |
| 334 return static_cast<JavaScriptFrame*>(frame); | 344 return static_cast<JavaScriptFrame*>(frame); |
| 335 } | 345 } |
| 336 | 346 |
| 337 | 347 |
| 338 } } // namespace v8::internal | 348 } } // namespace v8::internal |
| 339 | 349 |
| 340 #endif // V8_FRAMES_INL_H_ | 350 #endif // V8_FRAMES_INL_H_ |
| OLD | NEW |