Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 665 // but if we keep it matching StackPointer, the simulator can detect memory | 665 // but if we keep it matching StackPointer, the simulator can detect memory |
| 666 // accesses in the now-free part of the stack. | 666 // accesses in the now-free part of the stack. |
| 667 Mov(csp, StackPointer()); | 667 Mov(csp, StackPointer()); |
| 668 } | 668 } |
| 669 } | 669 } |
| 670 | 670 |
| 671 | 671 |
| 672 void MacroAssembler::PushMultipleTimes(int count, Register src) { | 672 void MacroAssembler::PushMultipleTimes(int count, Register src) { |
| 673 int size = src.SizeInBytes(); | 673 int size = src.SizeInBytes(); |
| 674 | 674 |
| 675 // TODO(all): Use a loop when optimizing for size. | 675 PrepareForPush(count, size); |
| 676 TODO_UNIMPLEMENTED("PushMultipleTimes: Support --optimize-for-size."); | |
| 677 | 676 |
| 678 PrepareForPush(count, size); | 677 if (FLAG_optimize_for_size && count > 4) { |
|
Rodolph Perfetta (ARM)
2014/02/06 15:14:36
The code below is 4 instructions long, PushMultipl
| |
| 678 Label loop; | |
| 679 __ Mov(Tmp0(), count); | |
| 680 __ Bind(&loop); | |
| 681 PushHelper(1, size, src, NoReg, NoReg, NoReg); | |
|
ulan
2014/02/06 14:53:12
Optimization: push 4 values at once (count / 4) ti
Rodolph Perfetta (ARM)
2014/02/06 15:14:36
if count is even you can push two at a time with n
Rodolph Perfetta (ARM)
2014/02/06 15:14:36
4 at a time will be faster but bigger, is that wha
| |
| 682 __ Subs(Tmp0(), Tmp0(), 1); | |
| 683 __ B(ne, &loop); | |
| 684 return; | |
| 685 } | |
| 686 | |
| 679 // Push up to four registers at a time if possible because if the current | 687 // Push up to four registers at a time if possible because if the current |
| 680 // stack pointer is csp and the register size is 32, registers must be pushed | 688 // stack pointer is csp and the register size is 32, registers must be pushed |
| 681 // in blocks of four in order to maintain the 16-byte alignment for csp. | 689 // in blocks of four in order to maintain the 16-byte alignment for csp. |
| 682 while (count >= 4) { | 690 while (count >= 4) { |
| 683 PushHelper(4, size, src, src, src, src); | 691 PushHelper(4, size, src, src, src, src); |
| 684 count -= 4; | 692 count -= 4; |
| 685 } | 693 } |
| 686 if (count >= 2) { | 694 if (count >= 2) { |
| 687 PushHelper(2, size, src, src, NoReg, NoReg); | 695 PushHelper(2, size, src, src, NoReg, NoReg); |
| 688 count -= 2; | 696 count -= 2; |
| (...skipping 4141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4830 } | 4838 } |
| 4831 } | 4839 } |
| 4832 | 4840 |
| 4833 | 4841 |
| 4834 #undef __ | 4842 #undef __ |
| 4835 | 4843 |
| 4836 | 4844 |
| 4837 } } // namespace v8::internal | 4845 } } // namespace v8::internal |
| 4838 | 4846 |
| 4839 #endif // V8_TARGET_ARCH_A64 | 4847 #endif // V8_TARGET_ARCH_A64 |
| OLD | NEW |