OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 return kind() == FINALLY; | 91 return kind() == FINALLY; |
92 } | 92 } |
93 | 93 |
94 | 94 |
95 inline StackHandler::Kind StackHandler::kind() const { | 95 inline StackHandler::Kind StackHandler::kind() const { |
96 const int offset = StackHandlerConstants::kStateOffset; | 96 const int offset = StackHandlerConstants::kStateOffset; |
97 return KindField::decode(Memory::unsigned_at(address() + offset)); | 97 return KindField::decode(Memory::unsigned_at(address() + offset)); |
98 } | 98 } |
99 | 99 |
100 | 100 |
| 101 inline unsigned StackHandler::index() const { |
| 102 const int offset = StackHandlerConstants::kStateOffset; |
| 103 return IndexField::decode(Memory::unsigned_at(address() + offset)); |
| 104 } |
| 105 |
| 106 |
101 inline Object** StackHandler::context_address() const { | 107 inline Object** StackHandler::context_address() const { |
102 const int offset = StackHandlerConstants::kContextOffset; | 108 const int offset = StackHandlerConstants::kContextOffset; |
103 return reinterpret_cast<Object**>(address() + offset); | 109 return reinterpret_cast<Object**>(address() + offset); |
104 } | 110 } |
105 | 111 |
106 | 112 |
107 inline Object** StackHandler::code_address() const { | 113 inline Object** StackHandler::code_address() const { |
108 const int offset = StackHandlerConstants::kCodeOffset; | 114 const int offset = StackHandlerConstants::kCodeOffset; |
109 return reinterpret_cast<Object**>(address() + offset); | 115 return reinterpret_cast<Object**>(address() + offset); |
110 } | 116 } |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 | 215 |
210 | 216 |
211 Object* JavaScriptFrame::GetParameter(int index) const { | 217 Object* JavaScriptFrame::GetParameter(int index) const { |
212 return Memory::Object_at(GetParameterSlot(index)); | 218 return Memory::Object_at(GetParameterSlot(index)); |
213 } | 219 } |
214 | 220 |
215 | 221 |
216 inline Address JavaScriptFrame::GetOperandSlot(int index) const { | 222 inline Address JavaScriptFrame::GetOperandSlot(int index) const { |
217 Address base = fp() + JavaScriptFrameConstants::kLocal0Offset; | 223 Address base = fp() + JavaScriptFrameConstants::kLocal0Offset; |
218 ASSERT(IsAddressAligned(base, kPointerSize)); | 224 ASSERT(IsAddressAligned(base, kPointerSize)); |
219 ASSERT(type() == JAVA_SCRIPT); | 225 ASSERT_EQ(type(), JAVA_SCRIPT); |
220 ASSERT(index < ComputeOperandsCount()); | 226 ASSERT_LT(index, ComputeOperandsCount()); |
| 227 ASSERT_LE(0, index); |
221 // Operand stack grows down. | 228 // Operand stack grows down. |
222 return base - index * kPointerSize; | 229 return base - index * kPointerSize; |
223 } | 230 } |
224 | 231 |
225 | 232 |
226 inline Object* JavaScriptFrame::GetOperand(int index) const { | 233 inline Object* JavaScriptFrame::GetOperand(int index) const { |
227 return Memory::Object_at(GetOperandSlot(index)); | 234 return Memory::Object_at(GetOperandSlot(index)); |
228 } | 235 } |
229 | 236 |
230 | 237 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 template<typename Iterator> | 363 template<typename Iterator> |
357 void JavaScriptFrameIteratorTemp<Iterator>::Reset() { | 364 void JavaScriptFrameIteratorTemp<Iterator>::Reset() { |
358 iterator_.Reset(); | 365 iterator_.Reset(); |
359 if (!done()) Advance(); | 366 if (!done()) Advance(); |
360 } | 367 } |
361 | 368 |
362 | 369 |
363 } } // namespace v8::internal | 370 } } // namespace v8::internal |
364 | 371 |
365 #endif // V8_FRAMES_INL_H_ | 372 #endif // V8_FRAMES_INL_H_ |
OLD | NEW |