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

Side by Side Diff: src/IceTargetLoweringX8632.cpp

Issue 633553003: emitIAS for push -- simplify push since it's not used for args passing anymore (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « src/IceTargetLoweringX8632.h ('k') | src/assembler_ia32.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===// 1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This file implements the TargetLoweringX8632 class, which 10 // This file implements the TargetLoweringX8632 class, which
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 uint32_t LocalsSpillAreaSize = SpillAreaSizeBytes; 744 uint32_t LocalsSpillAreaSize = SpillAreaSizeBytes;
745 745
746 SpillAreaSizeBytes += GlobalsSize; 746 SpillAreaSizeBytes += GlobalsSize;
747 747
748 // Add push instructions for preserved registers. 748 // Add push instructions for preserved registers.
749 uint32_t NumCallee = 0; 749 uint32_t NumCallee = 0;
750 for (SizeT i = 0; i < CalleeSaves.size(); ++i) { 750 for (SizeT i = 0; i < CalleeSaves.size(); ++i) {
751 if (CalleeSaves[i] && RegsUsed[i]) { 751 if (CalleeSaves[i] && RegsUsed[i]) {
752 ++NumCallee; 752 ++NumCallee;
753 PreservedRegsSizeBytes += 4; 753 PreservedRegsSizeBytes += 4;
754 const bool SuppressStackAdjustment = true; 754 _push(getPhysicalRegister(i));
755 _push(getPhysicalRegister(i), SuppressStackAdjustment);
756 } 755 }
757 } 756 }
758 Ctx->statsUpdateRegistersSaved(NumCallee); 757 Ctx->statsUpdateRegistersSaved(NumCallee);
759 758
760 // Generate "push ebp; mov ebp, esp" 759 // Generate "push ebp; mov ebp, esp"
761 if (IsEbpBasedFrame) { 760 if (IsEbpBasedFrame) {
762 assert((RegsUsed & getRegisterSet(RegSet_FramePointer, RegSet_None)) 761 assert((RegsUsed & getRegisterSet(RegSet_FramePointer, RegSet_None))
763 .count() == 0); 762 .count() == 0);
764 PreservedRegsSizeBytes += 4; 763 PreservedRegsSizeBytes += 4;
765 Variable *ebp = getPhysicalRegister(RegX8632::Reg_ebp); 764 Variable *ebp = getPhysicalRegister(RegX8632::Reg_ebp);
766 Variable *esp = getPhysicalRegister(RegX8632::Reg_esp); 765 Variable *esp = getPhysicalRegister(RegX8632::Reg_esp);
767 const bool SuppressStackAdjustment = true; 766 _push(ebp);
768 _push(ebp, SuppressStackAdjustment);
769 _mov(ebp, esp); 767 _mov(ebp, esp);
770 } 768 }
771 769
772 // Align the variables area. SpillAreaPaddingBytes is the size of 770 // Align the variables area. SpillAreaPaddingBytes is the size of
773 // the region after the preserved registers and before the spill 771 // the region after the preserved registers and before the spill
774 // areas. 772 // areas.
775 uint32_t SpillAreaPaddingBytes = 0; 773 uint32_t SpillAreaPaddingBytes = 0;
776 if (SpillAreaAlignmentBytes) { 774 if (SpillAreaAlignmentBytes) {
777 assert(SpillAreaAlignmentBytes <= X86_STACK_ALIGNMENT_BYTES); 775 assert(SpillAreaAlignmentBytes <= X86_STACK_ALIGNMENT_BYTES);
778 uint32_t PaddingStart = X86_RET_IP_SIZE_BYTES + PreservedRegsSizeBytes; 776 uint32_t PaddingStart = X86_RET_IP_SIZE_BYTES + PreservedRegsSizeBytes;
(...skipping 3741 matching lines...) Expand 10 before | Expand all | Expand 10 after
4520 Str << "\t.align\t" << Align << "\n"; 4518 Str << "\t.align\t" << Align << "\n";
4521 Str << MangledName << ":\n"; 4519 Str << MangledName << ":\n";
4522 for (SizeT i = 0; i < Size; ++i) { 4520 for (SizeT i = 0; i < Size; ++i) {
4523 Str << "\t.byte\t" << (((unsigned)Data[i]) & 0xff) << "\n"; 4521 Str << "\t.byte\t" << (((unsigned)Data[i]) & 0xff) << "\n";
4524 } 4522 }
4525 Str << "\t.size\t" << MangledName << ", " << Size << "\n"; 4523 Str << "\t.size\t" << MangledName << ", " << Size << "\n";
4526 } 4524 }
4527 } 4525 }
4528 4526
4529 } // end of namespace Ice 4527 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceTargetLoweringX8632.h ('k') | src/assembler_ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698