Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(352)

Side by Side Diff: src/frames.h

Issue 8462010: Add a level of indirection to exception handler addresses. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Incorporate review changes. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/code-stubs.cc ('k') | src/frames-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
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 State { 87 enum Kind {
88 ENTRY, 88 ENTRY,
89 TRY_CATCH, 89 TRY_CATCH,
90 TRY_FINALLY 90 TRY_FINALLY
91 }; 91 };
92 92
93 static const int kKindWidth = 2;
94 static const int kOffsetWidth = 32 - kKindWidth;
95 class KindField: public BitField<StackHandler::Kind, 0, kKindWidth> {};
96 class OffsetField: public BitField<unsigned, kKindWidth, kOffsetWidth> {};
97
93 // Get the address of this stack handler. 98 // Get the address of this stack handler.
94 inline Address address() const; 99 inline Address address() const;
95 100
96 // Get the next stack handler in the chain. 101 // Get the next stack handler in the chain.
97 inline StackHandler* next() const; 102 inline StackHandler* next() const;
98 103
99 // Tells whether the given address is inside this handler. 104 // Tells whether the given address is inside this handler.
100 inline bool includes(Address address) const; 105 inline bool includes(Address address) const;
101 106
102 // Garbage collection support. 107 // Garbage collection support.
103 inline void Iterate(ObjectVisitor* v, Code* holder) const; 108 inline void Iterate(ObjectVisitor* v, Code* holder) const;
104 109
105 // Conversion support. 110 // Conversion support.
106 static inline StackHandler* FromAddress(Address address); 111 static inline StackHandler* FromAddress(Address address);
107 112
108 // Testers 113 // Testers
109 inline bool is_entry() const; 114 inline bool is_entry() const;
110 inline bool is_try_catch() const; 115 inline bool is_try_catch() const;
111 inline bool is_try_finally() const; 116 inline bool is_try_finally() const;
112 117
113 private: 118 private:
114 // Accessors. 119 // Accessors.
115 inline State state() const; 120 inline Kind kind() const;
116 121
117 inline Object** context_address() const; 122 inline Object** context_address() const;
118 inline Address* pc_address() const; 123 inline Object** code_address() const;
119 124
120 DISALLOW_IMPLICIT_CONSTRUCTORS(StackHandler); 125 DISALLOW_IMPLICIT_CONSTRUCTORS(StackHandler);
121 }; 126 };
122 127
123 128
124 #define STACK_FRAME_TYPE_LIST(V) \ 129 #define STACK_FRAME_TYPE_LIST(V) \
125 V(ENTRY, EntryFrame) \ 130 V(ENTRY, EntryFrame) \
126 V(ENTRY_CONSTRUCT, EntryConstructFrame) \ 131 V(ENTRY_CONSTRUCT, EntryConstructFrame) \
127 V(EXIT, ExitFrame) \ 132 V(EXIT, ExitFrame) \
128 V(JAVA_SCRIPT, JavaScriptFrame) \ 133 V(JAVA_SCRIPT, JavaScriptFrame) \
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 }; 874 };
870 875
871 876
872 // Reads all frames on the current stack and copies them into the current 877 // Reads all frames on the current stack and copies them into the current
873 // zone memory. 878 // zone memory.
874 Vector<StackFrame*> CreateStackMap(); 879 Vector<StackFrame*> CreateStackMap();
875 880
876 } } // namespace v8::internal 881 } } // namespace v8::internal
877 882
878 #endif // V8_FRAMES_H_ 883 #endif // V8_FRAMES_H_
OLDNEW
« no previous file with comments | « src/code-stubs.cc ('k') | src/frames-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698