OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 } | 164 } |
165 | 165 |
166 | 166 |
167 inline bool JavaScriptFrame::has_adapted_arguments() const { | 167 inline bool JavaScriptFrame::has_adapted_arguments() const { |
168 return IsArgumentsAdaptorFrame(caller_fp()); | 168 return IsArgumentsAdaptorFrame(caller_fp()); |
169 } | 169 } |
170 | 170 |
171 | 171 |
172 inline bool JavaScriptFrame::is_at_function() const { | 172 inline bool JavaScriptFrame::is_at_function() const { |
173 Object* result = function_slot_object(); | 173 Object* result = function_slot_object(); |
| 174 // Verify that frame points at correct JS function object. |
| 175 // We are verifying that function object address and |
| 176 // the underlying map object address are valid, and that |
| 177 // function is really a function. |
174 return Heap::Contains(reinterpret_cast<Address>(result)) && | 178 return Heap::Contains(reinterpret_cast<Address>(result)) && |
| 179 result->IsHeapObject() && |
| 180 Heap::Contains(HeapObject::cast(result)->map()) && |
175 result->IsJSFunction(); | 181 result->IsJSFunction(); |
176 } | 182 } |
177 | 183 |
178 | 184 |
179 inline Object* JavaScriptFrame::function() const { | 185 inline Object* JavaScriptFrame::function() const { |
180 Object* result = function_slot_object(); | 186 Object* result = function_slot_object(); |
181 ASSERT(result->IsJSFunction()); | 187 ASSERT(result->IsJSFunction()); |
182 return result; | 188 return result; |
183 } | 189 } |
184 | 190 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 template<typename Iterator> | 230 template<typename Iterator> |
225 void JavaScriptFrameIteratorTemp<Iterator>::Reset() { | 231 void JavaScriptFrameIteratorTemp<Iterator>::Reset() { |
226 iterator_.Reset(); | 232 iterator_.Reset(); |
227 if (!done()) Advance(); | 233 if (!done()) Advance(); |
228 } | 234 } |
229 | 235 |
230 | 236 |
231 } } // namespace v8::internal | 237 } } // namespace v8::internal |
232 | 238 |
233 #endif // V8_FRAMES_INL_H_ | 239 #endif // V8_FRAMES_INL_H_ |
OLD | NEW |