| OLD | NEW |
| 1 // Copyright 2011 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 |
| 11 // with the distribution. | 11 // with the distribution. |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 static const int kInnerPointerToCodeCacheSize = 1024; | 78 static const int kInnerPointerToCodeCacheSize = 1024; |
| 79 InnerPointerToCodeCacheEntry cache_[kInnerPointerToCodeCacheSize]; | 79 InnerPointerToCodeCacheEntry cache_[kInnerPointerToCodeCacheSize]; |
| 80 | 80 |
| 81 DISALLOW_COPY_AND_ASSIGN(InnerPointerToCodeCache); | 81 DISALLOW_COPY_AND_ASSIGN(InnerPointerToCodeCache); |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 | 84 |
| 85 class StackHandler BASE_EMBEDDED { | 85 class StackHandler BASE_EMBEDDED { |
| 86 public: | 86 public: |
| 87 enum Kind { | 87 enum Kind { |
| 88 ENTRY, | 88 JS_ENTRY, |
| 89 TRY_CATCH, | 89 CATCH, |
| 90 TRY_FINALLY | 90 FINALLY, |
| 91 LAST_KIND = FINALLY |
| 91 }; | 92 }; |
| 92 | 93 |
| 93 static const int kKindWidth = 2; | 94 static const int kKindWidth = 2; |
| 94 static const int kOffsetWidth = 32 - kKindWidth; | 95 STATIC_ASSERT(LAST_KIND < (1 << kKindWidth)); |
| 96 static const int kIndexWidth = 32 - kKindWidth; |
| 95 class KindField: public BitField<StackHandler::Kind, 0, kKindWidth> {}; | 97 class KindField: public BitField<StackHandler::Kind, 0, kKindWidth> {}; |
| 96 class OffsetField: public BitField<unsigned, kKindWidth, kOffsetWidth> {}; | 98 class IndexField: public BitField<unsigned, kKindWidth, kIndexWidth> {}; |
| 97 | 99 |
| 98 // Get the address of this stack handler. | 100 // Get the address of this stack handler. |
| 99 inline Address address() const; | 101 inline Address address() const; |
| 100 | 102 |
| 101 // Get the next stack handler in the chain. | 103 // Get the next stack handler in the chain. |
| 102 inline StackHandler* next() const; | 104 inline StackHandler* next() const; |
| 103 | 105 |
| 104 // Tells whether the given address is inside this handler. | 106 // Tells whether the given address is inside this handler. |
| 105 inline bool includes(Address address) const; | 107 inline bool includes(Address address) const; |
| 106 | 108 |
| 107 // Garbage collection support. | 109 // Garbage collection support. |
| 108 inline void Iterate(ObjectVisitor* v, Code* holder) const; | 110 inline void Iterate(ObjectVisitor* v, Code* holder) const; |
| 109 | 111 |
| 110 // Conversion support. | 112 // Conversion support. |
| 111 static inline StackHandler* FromAddress(Address address); | 113 static inline StackHandler* FromAddress(Address address); |
| 112 | 114 |
| 113 // Testers | 115 // Testers |
| 114 inline bool is_entry() const; | 116 inline bool is_js_entry() const; |
| 115 inline bool is_try_catch() const; | 117 inline bool is_catch() const; |
| 116 inline bool is_try_finally() const; | 118 inline bool is_finally() const; |
| 117 | 119 |
| 118 private: | 120 private: |
| 119 // Accessors. | 121 // Accessors. |
| 120 inline Kind kind() const; | 122 inline Kind kind() const; |
| 121 | 123 |
| 122 inline Object** context_address() const; | 124 inline Object** context_address() const; |
| 123 inline Object** code_address() const; | 125 inline Object** code_address() const; |
| 124 | 126 |
| 125 DISALLOW_IMPLICIT_CONSTRUCTORS(StackHandler); | 127 DISALLOW_IMPLICIT_CONSTRUCTORS(StackHandler); |
| 126 }; | 128 }; |
| (...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 874 }; | 876 }; |
| 875 | 877 |
| 876 | 878 |
| 877 // Reads all frames on the current stack and copies them into the current | 879 // Reads all frames on the current stack and copies them into the current |
| 878 // zone memory. | 880 // zone memory. |
| 879 Vector<StackFrame*> CreateStackMap(); | 881 Vector<StackFrame*> CreateStackMap(); |
| 880 | 882 |
| 881 } } // namespace v8::internal | 883 } } // namespace v8::internal |
| 882 | 884 |
| 883 #endif // V8_FRAMES_H_ | 885 #endif // V8_FRAMES_H_ |
| OLD | NEW |