| 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 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 Object** parameters_limit = &Memory::Object_at( | 645 Object** parameters_limit = &Memory::Object_at( |
| 646 fp() + JavaScriptFrameConstants::kFunctionOffset - slot_space); | 646 fp() + JavaScriptFrameConstants::kFunctionOffset - slot_space); |
| 647 | 647 |
| 648 // Visit the parameters that may be on top of the saved registers. | 648 // Visit the parameters that may be on top of the saved registers. |
| 649 if (safepoint_entry.argument_count() > 0) { | 649 if (safepoint_entry.argument_count() > 0) { |
| 650 v->VisitPointers(parameters_base, | 650 v->VisitPointers(parameters_base, |
| 651 parameters_base + safepoint_entry.argument_count()); | 651 parameters_base + safepoint_entry.argument_count()); |
| 652 parameters_base += safepoint_entry.argument_count(); | 652 parameters_base += safepoint_entry.argument_count(); |
| 653 } | 653 } |
| 654 | 654 |
| 655 #if V8_TARGET_ARCH_ARM |
| 656 // The frame must have been generated within LCodegen::GeneratedCode where |
| 657 // registers_mask and double_registers_mask are set. |
| 658 ASSERT(code->registers_mask() != kRegListEmpty); |
| 659 // Skip saved double registers. |
| 660 if (safepoint_entry.has_doubles()) { |
| 661 parameters_base += |
| 662 CompilerIntrinsics::CountSetBits(code->double_registers_mask()) * |
| 663 kDoubleSize / kPointerSize; |
| 664 } |
| 665 |
| 666 // Visit the registers that contain pointers if any. |
| 667 if (safepoint_entry.HasRegisters()) { |
| 668 RegList registers_mask = code->registers_mask(); |
| 669 for (int i = 0; i < kNumSafepointRegisters; i++) { |
| 670 if ((registers_mask & (1 << i)) != 0) { |
| 671 if (safepoint_entry.HasRegisterAt(i)) { |
| 672 v->VisitPointer(parameters_base); |
| 673 } |
| 674 parameters_base++; |
| 675 } else { |
| 676 ASSERT(!safepoint_entry.HasRegisterAt(i)); |
| 677 } |
| 678 } |
| 679 } |
| 680 #else |
| 655 // Skip saved double registers. | 681 // Skip saved double registers. |
| 656 if (safepoint_entry.has_doubles()) { | 682 if (safepoint_entry.has_doubles()) { |
| 657 // Number of doubles not known at snapshot time. | 683 // Number of doubles not known at snapshot time. |
| 658 ASSERT(!Serializer::enabled()); | 684 ASSERT(!Serializer::enabled()); |
| 659 parameters_base += DoubleRegister::NumAllocatableRegisters() * | 685 parameters_base += DoubleRegister::NumAllocatableRegisters() * |
| 660 kDoubleSize / kPointerSize; | 686 kDoubleSize / kPointerSize; |
| 661 } | 687 } |
| 662 | 688 |
| 663 // Visit the registers that contain pointers if any. | 689 // Visit the registers that contain pointers if any. |
| 664 if (safepoint_entry.HasRegisters()) { | 690 if (safepoint_entry.HasRegisters()) { |
| 665 for (int i = kNumSafepointRegisters - 1; i >=0; i--) { | 691 for (int i = kNumSafepointRegisters - 1; i >=0; i--) { |
| 666 if (safepoint_entry.HasRegisterAt(i)) { | 692 if (safepoint_entry.HasRegisterAt(i)) { |
| 667 int reg_stack_index = MacroAssembler::SafepointRegisterStackIndex(i); | 693 int reg_stack_index = MacroAssembler::SafepointRegisterStackIndex(i); |
| 668 v->VisitPointer(parameters_base + reg_stack_index); | 694 v->VisitPointer(parameters_base + reg_stack_index); |
| 669 } | 695 } |
| 670 } | 696 } |
| 671 // Skip the words containing the register values. | 697 // Skip the words containing the register values. |
| 672 parameters_base += kNumSafepointRegisters; | 698 parameters_base += kNumSafepointRegisters; |
| 673 } | 699 } |
| 700 #endif |
| 674 | 701 |
| 675 // We're done dealing with the register bits. | 702 // We're done dealing with the register bits. |
| 676 uint8_t* safepoint_bits = safepoint_entry.bits(); | 703 uint8_t* safepoint_bits = safepoint_entry.bits(); |
| 677 safepoint_bits += kNumSafepointRegisters >> kBitsPerByteLog2; | 704 safepoint_bits += kNumSafepointRegisters >> kBitsPerByteLog2; |
| 678 | 705 |
| 679 // Visit the rest of the parameters. | 706 // Visit the rest of the parameters. |
| 680 v->VisitPointers(parameters_base, parameters_limit); | 707 v->VisitPointers(parameters_base, parameters_limit); |
| 681 | 708 |
| 682 // Visit pointer spill slots and locals. | 709 // Visit pointer spill slots and locals. |
| 683 for (unsigned index = 0; index < stack_slots; index++) { | 710 for (unsigned index = 0; index < stack_slots; index++) { |
| (...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1636 ZoneList<StackFrame*> list(10, zone); | 1663 ZoneList<StackFrame*> list(10, zone); |
| 1637 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { | 1664 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { |
| 1638 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 1665 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
| 1639 list.Add(frame, zone); | 1666 list.Add(frame, zone); |
| 1640 } | 1667 } |
| 1641 return list.ToVector(); | 1668 return list.ToVector(); |
| 1642 } | 1669 } |
| 1643 | 1670 |
| 1644 | 1671 |
| 1645 } } // namespace v8::internal | 1672 } } // namespace v8::internal |
| OLD | NEW |