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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 const int offset = JavaScriptFrameConstants::kReceiverOffset; | 162 const int offset = JavaScriptFrameConstants::kReceiverOffset; |
163 Memory::Object_at(pp() + offset) = value; | 163 Memory::Object_at(pp() + offset) = value; |
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 { |
| 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. |
| 178 return Heap::Contains(reinterpret_cast<Address>(result)) && |
| 179 result->IsHeapObject() && |
| 180 Heap::Contains(HeapObject::cast(result)->map()) && |
| 181 result->IsJSFunction(); |
| 182 } |
| 183 |
| 184 |
172 inline Object* JavaScriptFrame::function() const { | 185 inline Object* JavaScriptFrame::function() const { |
173 Object* result = function_slot_object(); | 186 Object* result = function_slot_object(); |
174 ASSERT(result->IsJSFunction()); | 187 ASSERT(result->IsJSFunction()); |
175 return result; | 188 return result; |
176 } | 189 } |
177 | 190 |
178 | 191 |
179 template<typename Iterator> | 192 template<typename Iterator> |
180 inline JavaScriptFrame* JavaScriptFrameIteratorTemp<Iterator>::frame() const { | 193 inline JavaScriptFrame* JavaScriptFrameIteratorTemp<Iterator>::frame() const { |
181 // TODO(1233797): The frame hierarchy needs to change. It's | 194 // TODO(1233797): The frame hierarchy needs to change. It's |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 template<typename Iterator> | 230 template<typename Iterator> |
218 void JavaScriptFrameIteratorTemp<Iterator>::Reset() { | 231 void JavaScriptFrameIteratorTemp<Iterator>::Reset() { |
219 iterator_.Reset(); | 232 iterator_.Reset(); |
220 if (!done()) Advance(); | 233 if (!done()) Advance(); |
221 } | 234 } |
222 | 235 |
223 | 236 |
224 } } // namespace v8::internal | 237 } } // namespace v8::internal |
225 | 238 |
226 #endif // V8_FRAMES_INL_H_ | 239 #endif // V8_FRAMES_INL_H_ |
OLD | NEW |