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 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 return reinterpret_cast<Code*>(code_slot()); | 524 return reinterpret_cast<Code*>(code_slot()); |
525 } | 525 } |
526 | 526 |
527 | 527 |
528 void ExitFrame::ComputeCallerState(State* state) const { | 528 void ExitFrame::ComputeCallerState(State* state) const { |
529 // Set up the caller state. | 529 // Set up the caller state. |
530 state->sp = caller_sp(); | 530 state->sp = caller_sp(); |
531 state->fp = Memory::Address_at(fp() + ExitFrameConstants::kCallerFPOffset); | 531 state->fp = Memory::Address_at(fp() + ExitFrameConstants::kCallerFPOffset); |
532 state->pc_address = ResolveReturnAddressLocation( | 532 state->pc_address = ResolveReturnAddressLocation( |
533 reinterpret_cast<Address*>(fp() + ExitFrameConstants::kCallerPCOffset)); | 533 reinterpret_cast<Address*>(fp() + ExitFrameConstants::kCallerPCOffset)); |
| 534 if (FLAG_enable_ool_constant_pool) { |
| 535 state->constant_pool_address = reinterpret_cast<Address*>( |
| 536 fp() + ExitFrameConstants::kConstantPoolOffset); |
| 537 } |
534 } | 538 } |
535 | 539 |
536 | 540 |
537 void ExitFrame::SetCallerFp(Address caller_fp) { | 541 void ExitFrame::SetCallerFp(Address caller_fp) { |
538 Memory::Address_at(fp() + ExitFrameConstants::kCallerFPOffset) = caller_fp; | 542 Memory::Address_at(fp() + ExitFrameConstants::kCallerFPOffset) = caller_fp; |
539 } | 543 } |
540 | 544 |
541 | 545 |
542 void ExitFrame::Iterate(ObjectVisitor* v) const { | 546 void ExitFrame::Iterate(ObjectVisitor* v) const { |
543 // The arguments are traversed as part of the expression stack of | 547 // The arguments are traversed as part of the expression stack of |
(...skipping 23 matching lines...) Expand all Loading... |
567 Address ExitFrame::ComputeStackPointer(Address fp) { | 571 Address ExitFrame::ComputeStackPointer(Address fp) { |
568 return Memory::Address_at(fp + ExitFrameConstants::kSPOffset); | 572 return Memory::Address_at(fp + ExitFrameConstants::kSPOffset); |
569 } | 573 } |
570 | 574 |
571 | 575 |
572 void ExitFrame::FillState(Address fp, Address sp, State* state) { | 576 void ExitFrame::FillState(Address fp, Address sp, State* state) { |
573 state->sp = sp; | 577 state->sp = sp; |
574 state->fp = fp; | 578 state->fp = fp; |
575 state->pc_address = ResolveReturnAddressLocation( | 579 state->pc_address = ResolveReturnAddressLocation( |
576 reinterpret_cast<Address*>(sp - 1 * kPCOnStackSize)); | 580 reinterpret_cast<Address*>(sp - 1 * kPCOnStackSize)); |
| 581 state->constant_pool_address = |
| 582 reinterpret_cast<Address*>(fp + ExitFrameConstants::kConstantPoolOffset); |
577 } | 583 } |
578 | 584 |
579 | 585 |
580 Address StandardFrame::GetExpressionAddress(int n) const { | 586 Address StandardFrame::GetExpressionAddress(int n) const { |
581 const int offset = StandardFrameConstants::kExpressionsOffset; | 587 const int offset = StandardFrameConstants::kExpressionsOffset; |
582 return fp() + offset - n * kPointerSize; | 588 return fp() + offset - n * kPointerSize; |
583 } | 589 } |
584 | 590 |
585 | 591 |
586 Object* StandardFrame::GetExpression(Address fp, int index) { | 592 Object* StandardFrame::GetExpression(Address fp, int index) { |
(...skipping 16 matching lines...) Expand all Loading... |
603 // Include register-allocated locals in number of expressions. | 609 // Include register-allocated locals in number of expressions. |
604 return static_cast<int>((base - limit) / kPointerSize); | 610 return static_cast<int>((base - limit) / kPointerSize); |
605 } | 611 } |
606 | 612 |
607 | 613 |
608 void StandardFrame::ComputeCallerState(State* state) const { | 614 void StandardFrame::ComputeCallerState(State* state) const { |
609 state->sp = caller_sp(); | 615 state->sp = caller_sp(); |
610 state->fp = caller_fp(); | 616 state->fp = caller_fp(); |
611 state->pc_address = ResolveReturnAddressLocation( | 617 state->pc_address = ResolveReturnAddressLocation( |
612 reinterpret_cast<Address*>(ComputePCAddress(fp()))); | 618 reinterpret_cast<Address*>(ComputePCAddress(fp()))); |
| 619 state->constant_pool_address = |
| 620 reinterpret_cast<Address*>(ComputeConstantPoolAddress(fp())); |
613 } | 621 } |
614 | 622 |
615 | 623 |
616 void StandardFrame::SetCallerFp(Address caller_fp) { | 624 void StandardFrame::SetCallerFp(Address caller_fp) { |
617 Memory::Address_at(fp() + StandardFrameConstants::kCallerFPOffset) = | 625 Memory::Address_at(fp() + StandardFrameConstants::kCallerFPOffset) = |
618 caller_fp; | 626 caller_fp; |
619 } | 627 } |
620 | 628 |
621 | 629 |
622 bool StandardFrame::IsExpressionInsideHandler(int n) const { | 630 bool StandardFrame::IsExpressionInsideHandler(int n) const { |
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1636 ZoneList<StackFrame*> list(10, zone); | 1644 ZoneList<StackFrame*> list(10, zone); |
1637 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { | 1645 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { |
1638 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 1646 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
1639 list.Add(frame, zone); | 1647 list.Add(frame, zone); |
1640 } | 1648 } |
1641 return list.ToVector(); | 1649 return list.ToVector(); |
1642 } | 1650 } |
1643 | 1651 |
1644 | 1652 |
1645 } } // namespace v8::internal | 1653 } } // namespace v8::internal |
OLD | NEW |