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