Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: src/arm/deoptimizer-arm.cc

Issue 6930038: ARM: Reduce amount of code generated for context save on deopt.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 CpuFeatures::Scope scope(VFP3); 542 CpuFeatures::Scope scope(VFP3);
543 // Save all general purpose registers before messing with them. 543 // Save all general purpose registers before messing with them.
544 const int kNumberOfRegisters = Register::kNumRegisters; 544 const int kNumberOfRegisters = Register::kNumRegisters;
545 545
546 // Everything but pc, lr and ip which will be saved but not restored. 546 // Everything but pc, lr and ip which will be saved but not restored.
547 RegList restored_regs = kJSCallerSaved | kCalleeSaved | ip.bit(); 547 RegList restored_regs = kJSCallerSaved | kCalleeSaved | ip.bit();
548 548
549 const int kDoubleRegsSize = 549 const int kDoubleRegsSize =
550 kDoubleSize * DwVfpRegister::kNumAllocatableRegisters; 550 kDoubleSize * DwVfpRegister::kNumAllocatableRegisters;
551 551
552 // Save all general purpose registers before messing with them. 552 // Save all VFP registers before messing with them.
553 __ sub(sp, sp, Operand(kDoubleRegsSize)); 553 DwVfpRegister first = DwVfpRegister::FromAllocationIndex(0);
554 for (int i = 0; i < DwVfpRegister::kNumAllocatableRegisters; ++i) { 554 DwVfpRegister last =
555 DwVfpRegister vfp_reg = DwVfpRegister::FromAllocationIndex(i); 555 DwVfpRegister::FromAllocationIndex(
556 int offset = i * kDoubleSize; 556 DwVfpRegister::kNumAllocatableRegisters - 1);
557 __ vstr(vfp_reg, sp, offset); 557 ASSERT(last.code() > first.code());
558 ASSERT((last.code() - first.code()) ==
559 (DwVfpRegister::kNumAllocatableRegisters - 1));
560 #ifdef DEBUG
561 for (int i = 0; i <= (DwVfpRegister::kNumAllocatableRegisters - 1); i++) {
562 ASSERT((DwVfpRegister::FromAllocationIndex(i).code() <= last.code()) &&
563 (DwVfpRegister::FromAllocationIndex(i).code() >= first.code()));
558 } 564 }
565 #endif
566 __ vstm(db_w, sp, first, last);
559 567
560 // Push all 16 registers (needed to populate FrameDescription::registers_). 568 // Push all 16 registers (needed to populate FrameDescription::registers_).
561 __ stm(db_w, sp, restored_regs | sp.bit() | lr.bit() | pc.bit()); 569 __ stm(db_w, sp, restored_regs | sp.bit() | lr.bit() | pc.bit());
562 570
563 const int kSavedRegistersAreaSize = 571 const int kSavedRegistersAreaSize =
564 (kNumberOfRegisters * kPointerSize) + kDoubleRegsSize; 572 (kNumberOfRegisters * kPointerSize) + kDoubleRegsSize;
565 573
566 // Get the bailout id from the stack. 574 // Get the bailout id from the stack.
567 __ ldr(r2, MemOperand(sp, kSavedRegistersAreaSize)); 575 __ ldr(r2, MemOperand(sp, kSavedRegistersAreaSize));
568 576
(...skipping 27 matching lines...) Expand all
596 __ str(r5, MemOperand(sp, 1 * kPointerSize)); // Isolate. 604 __ str(r5, MemOperand(sp, 1 * kPointerSize)); // Isolate.
597 // Call Deoptimizer::New(). 605 // Call Deoptimizer::New().
598 __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate), 6); 606 __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate), 6);
599 607
600 // Preserve "deoptimizer" object in register r0 and get the input 608 // Preserve "deoptimizer" object in register r0 and get the input
601 // frame descriptor pointer to r1 (deoptimizer->input_); 609 // frame descriptor pointer to r1 (deoptimizer->input_);
602 __ ldr(r1, MemOperand(r0, Deoptimizer::input_offset())); 610 __ ldr(r1, MemOperand(r0, Deoptimizer::input_offset()));
603 611
604 // Copy core registers into FrameDescription::registers_[kNumRegisters]. 612 // Copy core registers into FrameDescription::registers_[kNumRegisters].
605 ASSERT(Register::kNumRegisters == kNumberOfRegisters); 613 ASSERT(Register::kNumRegisters == kNumberOfRegisters);
606 for (int i = 0; i < kNumberOfRegisters; i++) { 614 ASSERT(kNumberOfRegisters % 2 == 0);
607 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); 615
608 __ ldr(r2, MemOperand(sp, i * kPointerSize)); 616 Label arm_loop;
609 __ str(r2, MemOperand(r1, offset)); 617 __ add(r6, r1, Operand(FrameDescription::registers_offset()));
610 } 618 __ mov(r5, Operand(sp));
619 __ mov(r4, Operand(kNumberOfRegisters / 2));
620
621 __ bind(&arm_loop);
622 __ Ldrd(r2, r3, MemOperand(r5, kPointerSize * 2, PostIndex));
623 __ sub(r4, r4, Operand(1), SetCC);
624 __ Strd(r2, r3, MemOperand(r6, kPointerSize * 2, PostIndex));
625 __ b(gt, &arm_loop);
611 626
612 // Copy VFP registers to 627 // Copy VFP registers to
613 // double_registers_[DoubleRegister::kNumAllocatableRegisters] 628 // double_registers_[DoubleRegister::kNumAllocatableRegisters]
614 int double_regs_offset = FrameDescription::double_registers_offset(); 629 Label vfp_loop;
615 for (int i = 0; i < DwVfpRegister::kNumAllocatableRegisters; ++i) { 630 __ add(r6, r1, Operand(FrameDescription::double_registers_offset()));
616 int dst_offset = i * kDoubleSize + double_regs_offset; 631 __ mov(r4, Operand(DwVfpRegister::kNumAllocatableRegisters));
617 int src_offset = i * kDoubleSize + kNumberOfRegisters * kPointerSize; 632
618 __ vldr(d0, sp, src_offset); 633 __ bind(&vfp_loop);
619 __ vstr(d0, r1, dst_offset); 634 __ Ldrd(r2, r3, MemOperand(r5, kDoubleSize, PostIndex));
620 } 635 __ sub(r4, r4, Operand(1), SetCC);
636 __ Strd(r2, r3, MemOperand(r6, kDoubleSize, PostIndex));
637 __ b(gt, &vfp_loop);
621 638
622 // Remove the bailout id, eventually return address, and the saved registers 639 // Remove the bailout id, eventually return address, and the saved registers
623 // from the stack. 640 // from the stack.
624 if (type() == EAGER || type() == OSR) { 641 if (type() == EAGER || type() == OSR) {
625 __ add(sp, sp, Operand(kSavedRegistersAreaSize + (1 * kPointerSize))); 642 __ add(sp, sp, Operand(kSavedRegistersAreaSize + (1 * kPointerSize)));
626 } else { 643 } else {
627 __ add(sp, sp, Operand(kSavedRegistersAreaSize + (2 * kPointerSize))); 644 __ add(sp, sp, Operand(kSavedRegistersAreaSize + (2 * kPointerSize)));
628 } 645 }
629 646
630 // Compute a pointer to the unwinding limit in register r2; that is 647 // Compute a pointer to the unwinding limit in register r2; that is
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 __ push(ip); 745 __ push(ip);
729 __ b(&done); 746 __ b(&done);
730 ASSERT(masm()->pc_offset() - start == table_entry_size_); 747 ASSERT(masm()->pc_offset() - start == table_entry_size_);
731 } 748 }
732 __ bind(&done); 749 __ bind(&done);
733 } 750 }
734 751
735 #undef __ 752 #undef __
736 753
737 } } // namespace v8::internal 754 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698