| 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 return Heap::Contains(reinterpret_cast<Address>(result)) && |
| 175 result->IsJSFunction(); |
| 176 } |
| 177 |
| 178 |
| 179 inline Object* JavaScriptFrame::function() const { |
| 180 Object* result = function_slot_object(); |
| 181 ASSERT(result->IsJSFunction()); |
| 182 return result; |
| 183 } |
| 184 |
| 185 |
| 172 template<typename Iterator> | 186 template<typename Iterator> |
| 173 inline JavaScriptFrame* JavaScriptFrameIteratorTemp<Iterator>::frame() const { | 187 inline JavaScriptFrame* JavaScriptFrameIteratorTemp<Iterator>::frame() const { |
| 174 // TODO(1233797): The frame hierarchy needs to change. It's | 188 // TODO(1233797): The frame hierarchy needs to change. It's |
| 175 // problematic that we can't use the safe-cast operator to cast to | 189 // problematic that we can't use the safe-cast operator to cast to |
| 176 // the JavaScript frame type, because we may encounter arguments | 190 // the JavaScript frame type, because we may encounter arguments |
| 177 // adaptor frames. | 191 // adaptor frames. |
| 178 StackFrame* frame = iterator_.frame(); | 192 StackFrame* frame = iterator_.frame(); |
| 179 ASSERT(frame->is_java_script() || frame->is_arguments_adaptor()); | 193 ASSERT(frame->is_java_script() || frame->is_arguments_adaptor()); |
| 180 return static_cast<JavaScriptFrame*>(frame); | 194 return static_cast<JavaScriptFrame*>(frame); |
| 181 } | 195 } |
| (...skipping 28 matching lines...) Expand all Loading... |
| 210 template<typename Iterator> | 224 template<typename Iterator> |
| 211 void JavaScriptFrameIteratorTemp<Iterator>::Reset() { | 225 void JavaScriptFrameIteratorTemp<Iterator>::Reset() { |
| 212 iterator_.Reset(); | 226 iterator_.Reset(); |
| 213 if (!done()) Advance(); | 227 if (!done()) Advance(); |
| 214 } | 228 } |
| 215 | 229 |
| 216 | 230 |
| 217 } } // namespace v8::internal | 231 } } // namespace v8::internal |
| 218 | 232 |
| 219 #endif // V8_FRAMES_INL_H_ | 233 #endif // V8_FRAMES_INL_H_ |
| OLD | NEW |