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

Side by Side Diff: unittest/AssemblerX8632/TestUtil.h

Issue 1669443002: Subzero. Uses fixups to calculate addend to relocations. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addresses comments. Created 4 years, 10 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
OLDNEW
1 //===- subzero/unittest/unittest/AssemblerX8632/TestUtil.h ------*- C++ -*-===// 1 //===- subzero/unittest/unittest/AssemblerX8632/TestUtil.h ------*- C++ -*-===//
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 // Utility classes for testing the X8632 Assembler. 10 // Utility classes for testing the X8632 Assembler.
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 size_t Size; 722 size_t Size;
723 }; 723 };
724 724
725 // assemble created an AssembledTest with the jitted code. The first time 725 // assemble created an AssembledTest with the jitted code. The first time
726 // assemble is executed it will add the epilogue to the jitted code (which is 726 // assemble is executed it will add the epilogue to the jitted code (which is
727 // the reason why this method is not const qualified. 727 // the reason why this method is not const qualified.
728 AssembledTest assemble() { 728 AssembledTest assemble() {
729 if (NeedsEpilogue) { 729 if (NeedsEpilogue) {
730 addEpilogue(); 730 addEpilogue();
731 } 731 }
732 NeedsEpilogue = false;
732 733
733 NeedsEpilogue = false; 734 for (auto *Fixup : assembler()->fixups()) {
Jim Stichnoth 2016/02/03 23:18:27 const auto *Fixup, right?
John 2016/02/04 18:28:50 Done.
735 Fixup->emitOffset(assembler());
736 }
737
734 return AssembledTest(codeBytes(), codeBytesSize(), NumAllocatedDwords); 738 return AssembledTest(codeBytes(), codeBytesSize(), NumAllocatedDwords);
735 } 739 }
736 740
737 // Allocates a new dword slot in the test's scratchpad area. 741 // Allocates a new dword slot in the test's scratchpad area.
738 uint32_t allocateDword() { return NumAllocatedDwords++; } 742 uint32_t allocateDword() { return NumAllocatedDwords++; }
739 743
740 // Allocates a new qword slot in the test's scratchpad area. 744 // Allocates a new qword slot in the test's scratchpad area.
741 uint32_t allocateQword() { 745 uint32_t allocateQword() {
742 uint32_t InitialDword = allocateDword(); 746 uint32_t InitialDword = allocateDword();
743 allocateDword(); 747 allocateDword();
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 845
842 bool NeedsEpilogue; 846 bool NeedsEpilogue;
843 uint32_t NumAllocatedDwords; 847 uint32_t NumAllocatedDwords;
844 }; 848 };
845 849
846 } // end of namespace Test 850 } // end of namespace Test
847 } // end of namespace X8632 851 } // end of namespace X8632
848 } // end of namespace Ice 852 } // end of namespace Ice
849 853
850 #endif // ASSEMBLERX8632_TESTUTIL_H_ 854 #endif // ASSEMBLERX8632_TESTUTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698