| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 } | 141 } |
| 142 | 142 |
| 143 | 143 |
| 144 inline bool StandardFrame::IsConstructFrame(Address fp) { | 144 inline bool StandardFrame::IsConstructFrame(Address fp) { |
| 145 Object* marker = | 145 Object* marker = |
| 146 Memory::Object_at(fp + StandardFrameConstants::kMarkerOffset); | 146 Memory::Object_at(fp + StandardFrameConstants::kMarkerOffset); |
| 147 return marker == Smi::FromInt(CONSTRUCT); | 147 return marker == Smi::FromInt(CONSTRUCT); |
| 148 } | 148 } |
| 149 | 149 |
| 150 | 150 |
| 151 Address JavaScriptFrame::GetParameterSlot(int index) const { | |
| 152 int param_count = ComputeParametersCount(); | |
| 153 ASSERT(-1 <= index && index < param_count); | |
| 154 int parameter_offset = (param_count - index - 1) * kPointerSize; | |
| 155 return caller_sp() + parameter_offset; | |
| 156 } | |
| 157 | |
| 158 | |
| 159 Object* JavaScriptFrame::GetParameter(int index) const { | |
| 160 return Memory::Object_at(GetParameterSlot(index)); | |
| 161 } | |
| 162 | |
| 163 | |
| 164 inline Object* JavaScriptFrame::receiver() const { | 151 inline Object* JavaScriptFrame::receiver() const { |
| 165 return GetParameter(-1); | 152 const int offset = JavaScriptFrameConstants::kReceiverOffset; |
| 153 return Memory::Object_at(caller_sp() + offset); |
| 166 } | 154 } |
| 167 | 155 |
| 168 | 156 |
| 169 inline void JavaScriptFrame::set_receiver(Object* value) { | 157 inline void JavaScriptFrame::set_receiver(Object* value) { |
| 170 Memory::Object_at(GetParameterSlot(-1)) = value; | 158 const int offset = JavaScriptFrameConstants::kReceiverOffset; |
| 159 Memory::Object_at(caller_sp() + offset) = value; |
| 171 } | 160 } |
| 172 | 161 |
| 173 | 162 |
| 174 inline bool JavaScriptFrame::has_adapted_arguments() const { | 163 inline bool JavaScriptFrame::has_adapted_arguments() const { |
| 175 return IsArgumentsAdaptorFrame(caller_fp()); | 164 return IsArgumentsAdaptorFrame(caller_fp()); |
| 176 } | 165 } |
| 177 | 166 |
| 178 | 167 |
| 179 inline Object* JavaScriptFrame::function() const { | 168 inline Object* JavaScriptFrame::function() const { |
| 180 Object* result = function_slot_object(); | 169 Object* result = function_slot_object(); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 template<typename Iterator> | 227 template<typename Iterator> |
| 239 void JavaScriptFrameIteratorTemp<Iterator>::Reset() { | 228 void JavaScriptFrameIteratorTemp<Iterator>::Reset() { |
| 240 iterator_.Reset(); | 229 iterator_.Reset(); |
| 241 if (!done()) Advance(); | 230 if (!done()) Advance(); |
| 242 } | 231 } |
| 243 | 232 |
| 244 | 233 |
| 245 } } // namespace v8::internal | 234 } } // namespace v8::internal |
| 246 | 235 |
| 247 #endif // V8_FRAMES_INL_H_ | 236 #endif // V8_FRAMES_INL_H_ |
| OLD | NEW |