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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 | 247 |
248 Code* ExitFrame::FindCode() const { | 248 Code* ExitFrame::FindCode() const { |
249 return Heap::c_entry_code(); | 249 return Heap::c_entry_code(); |
250 } | 250 } |
251 | 251 |
252 | 252 |
253 StackFrame::Type ExitFrame::GetCallerState(State* state) const { | 253 StackFrame::Type ExitFrame::GetCallerState(State* state) const { |
254 // Setup the caller state. | 254 // Setup the caller state. |
255 state->sp = pp(); | 255 state->sp = pp(); |
256 state->fp = Memory::Address_at(fp() + ExitFrameConstants::kCallerFPOffset); | 256 state->fp = Memory::Address_at(fp() + ExitFrameConstants::kCallerFPOffset); |
257 #ifdef USE_OLD_CALLING_CONVENTIONS | |
258 state->pp = Memory::Address_at(fp() + ExitFrameConstants::kCallerPPOffset); | |
259 #endif | |
260 state->pc_address | 257 state->pc_address |
261 = reinterpret_cast<Address*>(fp() + ExitFrameConstants::kCallerPCOffset); | 258 = reinterpret_cast<Address*>(fp() + ExitFrameConstants::kCallerPCOffset); |
262 return ComputeType(state); | 259 return ComputeType(state); |
263 } | 260 } |
264 | 261 |
265 | 262 |
266 Address ExitFrame::GetCallerStackPointer() const { | 263 Address ExitFrame::GetCallerStackPointer() const { |
267 return fp() + ExitFrameConstants::kPPDisplacement; | 264 return fp() + ExitFrameConstants::kPPDisplacement; |
268 } | 265 } |
269 | 266 |
(...skipping 16 matching lines...) Expand all Loading... |
286 Address limit = sp(); | 283 Address limit = sp(); |
287 ASSERT(base >= limit); // stack grows downwards | 284 ASSERT(base >= limit); // stack grows downwards |
288 // Include register-allocated locals in number of expressions. | 285 // Include register-allocated locals in number of expressions. |
289 return (base - limit) / kPointerSize; | 286 return (base - limit) / kPointerSize; |
290 } | 287 } |
291 | 288 |
292 | 289 |
293 StackFrame::Type StandardFrame::GetCallerState(State* state) const { | 290 StackFrame::Type StandardFrame::GetCallerState(State* state) const { |
294 state->sp = caller_sp(); | 291 state->sp = caller_sp(); |
295 state->fp = caller_fp(); | 292 state->fp = caller_fp(); |
296 #ifdef USE_OLD_CALLING_CONVENTIONS | |
297 state->pp = caller_pp(); | |
298 #endif | |
299 state->pc_address = reinterpret_cast<Address*>(ComputePCAddress(fp())); | 293 state->pc_address = reinterpret_cast<Address*>(ComputePCAddress(fp())); |
300 return ComputeType(state); | 294 return ComputeType(state); |
301 } | 295 } |
302 | 296 |
303 | 297 |
304 bool StandardFrame::IsExpressionInsideHandler(int n) const { | 298 bool StandardFrame::IsExpressionInsideHandler(int n) const { |
305 Address address = GetExpressionAddress(n); | 299 Address address = GetExpressionAddress(n); |
306 for (StackHandlerIterator it(this, top_handler()); !it.done(); it.Advance()) { | 300 for (StackHandlerIterator it(this, top_handler()); !it.done(); it.Advance()) { |
307 if (it.handler()->includes(address)) return true; | 301 if (it.handler()->includes(address)) return true; |
308 } | 302 } |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 reg_code[i++] = r; | 586 reg_code[i++] = r; |
593 | 587 |
594 ASSERT(i == kNumJSCallerSaved); | 588 ASSERT(i == kNumJSCallerSaved); |
595 } | 589 } |
596 ASSERT(0 <= n && n < kNumJSCallerSaved); | 590 ASSERT(0 <= n && n < kNumJSCallerSaved); |
597 return reg_code[n]; | 591 return reg_code[n]; |
598 } | 592 } |
599 | 593 |
600 | 594 |
601 } } // namespace v8::internal | 595 } } // namespace v8::internal |
OLD | NEW |