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

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

Issue 1537703002: Subzero. x8664. Resurrects the Target. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addresses comments. Created 4 years, 12 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 1
2 //===- subzero/unittest/unittest/AssemblerX8664/TestUtil.h ------*- C++ -*-===// 2 //===- subzero/unittest/unittest/AssemblerX8664/TestUtil.h ------*- C++ -*-===//
3 // 3 //
4 // The Subzero Code Generator 4 // The Subzero Code Generator
5 // 5 //
6 // This file is distributed under the University of Illinois Open Source 6 // This file is distributed under the University of Illinois Open Source
7 // License. See LICENSE.TXT for details. 7 // License. See LICENSE.TXT for details.
8 // 8 //
9 //===----------------------------------------------------------------------===// 9 //===----------------------------------------------------------------------===//
10 // 10 //
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 694
695 AssembledTest(const uint8_t *Data, const size_t MySize, 695 AssembledTest(const uint8_t *Data, const size_t MySize,
696 const size_t ExtraStorageDwords) 696 const size_t ExtraStorageDwords)
697 : Size(MaximumCodeSize + 4 * ExtraStorageDwords) { 697 : Size(MaximumCodeSize + 4 * ExtraStorageDwords) {
698 // MaxCodeSize is needed because EXPECT_LT needs a symbol with a name -- 698 // MaxCodeSize is needed because EXPECT_LT needs a symbol with a name --
699 // probably a compiler bug? 699 // probably a compiler bug?
700 uint32_t MaxCodeSize = MaximumCodeSize; 700 uint32_t MaxCodeSize = MaximumCodeSize;
701 EXPECT_LT(MySize, MaxCodeSize); 701 EXPECT_LT(MySize, MaxCodeSize);
702 assert(MySize < MaximumCodeSize); 702 assert(MySize < MaximumCodeSize);
703 ExecutableData = mmap(nullptr, Size, PROT_WRITE | PROT_READ | PROT_EXEC, 703 ExecutableData = mmap(nullptr, Size, PROT_WRITE | PROT_READ | PROT_EXEC,
704 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); 704 MAP_PRIVATE | MAP_ANONYMOUS | MAP_32BIT, -1, 0);
705 EXPECT_NE(MAP_FAILED, ExecutableData) << strerror(errno); 705 EXPECT_NE(MAP_FAILED, ExecutableData) << strerror(errno);
706 assert(MAP_FAILED != ExecutableData); 706 assert(MAP_FAILED != ExecutableData);
707 std::memcpy(ExecutableData, Data, MySize); 707 std::memcpy(ExecutableData, Data, MySize);
708 } 708 }
709 709
710 // We allow AssembledTest to be moved so that we can return objects of 710 // We allow AssembledTest to be moved so that we can return objects of
711 // this type. 711 // this type.
712 AssembledTest(AssembledTest &&Buffer) 712 AssembledTest(AssembledTest &&Buffer)
713 : ExecutableData(Buffer.ExecutableData), Size(Buffer.Size) { 713 : ExecutableData(Buffer.ExecutableData), Size(Buffer.Size) {
714 Buffer.ExecutableData = nullptr; 714 Buffer.ExecutableData = nullptr;
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
1094 1094
1095 bool NeedsEpilogue; 1095 bool NeedsEpilogue;
1096 uint32_t NumAllocatedDwords; 1096 uint32_t NumAllocatedDwords;
1097 }; 1097 };
1098 1098
1099 } // end of namespace Test 1099 } // end of namespace Test
1100 } // end of namespace X8664 1100 } // end of namespace X8664
1101 } // end of namespace Ice 1101 } // end of namespace Ice
1102 1102
1103 #endif // ASSEMBLERX8664_TESTUTIL_H_ 1103 #endif // ASSEMBLERX8664_TESTUTIL_H_
OLDNEW
« src/IceTargetLoweringX8632Traits.h ('K') | « unittest/AssemblerX8664/LowLevel.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698