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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 } | 401 } |
402 | 402 |
403 | 403 |
404 Object*& ExitFrame::code_slot() const { | 404 Object*& ExitFrame::code_slot() const { |
405 const int offset = ExitFrameConstants::kCodeOffset; | 405 const int offset = ExitFrameConstants::kCodeOffset; |
406 return Memory::Object_at(fp() + offset); | 406 return Memory::Object_at(fp() + offset); |
407 } | 407 } |
408 | 408 |
409 | 409 |
410 Code* ExitFrame::code() const { | 410 Code* ExitFrame::code() const { |
411 Object* code = code_slot(); | 411 return Code::cast(code_slot()); |
412 if (code->IsSmi()) { | |
413 return Heap::debugger_statement_code(); | |
414 } else { | |
415 return Code::cast(code); | |
416 } | |
417 } | 412 } |
418 | 413 |
419 | 414 |
420 void ExitFrame::ComputeCallerState(State* state) const { | 415 void ExitFrame::ComputeCallerState(State* state) const { |
421 // Setup the caller state. | 416 // Setup the caller state. |
422 state->sp = caller_sp(); | 417 state->sp = caller_sp(); |
423 state->fp = Memory::Address_at(fp() + ExitFrameConstants::kCallerFPOffset); | 418 state->fp = Memory::Address_at(fp() + ExitFrameConstants::kCallerFPOffset); |
424 state->pc_address | 419 state->pc_address |
425 = reinterpret_cast<Address*>(fp() + ExitFrameConstants::kCallerPCOffset); | 420 = reinterpret_cast<Address*>(fp() + ExitFrameConstants::kCallerPCOffset); |
426 } | 421 } |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 reg_code[i++] = r; | 743 reg_code[i++] = r; |
749 | 744 |
750 ASSERT(i == kNumJSCallerSaved); | 745 ASSERT(i == kNumJSCallerSaved); |
751 } | 746 } |
752 ASSERT(0 <= n && n < kNumJSCallerSaved); | 747 ASSERT(0 <= n && n < kNumJSCallerSaved); |
753 return reg_code[n]; | 748 return reg_code[n]; |
754 } | 749 } |
755 | 750 |
756 | 751 |
757 } } // namespace v8::internal | 752 } } // namespace v8::internal |
OLD | NEW |