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

Unified Diff: src/assembler_ia32.cpp

Issue 874353006: Write out global initializers and data rel directly to ELF file. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: tweak comment Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: src/assembler_ia32.cpp
diff --git a/src/assembler_ia32.cpp b/src/assembler_ia32.cpp
index 88ad7ef79aa03f60d58c3df20443797449d54175..d4fff33dcb1522465c2812ed079f9edbf2126866 100644
--- a/src/assembler_ia32.cpp
+++ b/src/assembler_ia32.cpp
@@ -43,19 +43,13 @@ AssemblerX86::~AssemblerX86() {
}
void AssemblerX86::alignFunction() {
- intptr_t Pos = buffer_.GetPosition();
SizeT Align = 1 << getBundleAlignLog2Bytes();
- intptr_t Mod = Pos & (Align - 1);
- if (Mod == 0) {
- return;
- }
- SizeT BytesNeeded = Align - Mod;
+ SizeT BytesNeeded = Utils::OffsetToAlignment(buffer_.GetPosition(), Align);
const SizeT HltSize = 1;
while (BytesNeeded > 0) {
hlt();
BytesNeeded -= HltSize;
}
- assert((buffer_.GetPosition() & (Align - 1)) == 0);
}
Label *AssemblerX86::GetOrCreateLabel(SizeT Number, LabelVector &Labels) {

Powered by Google App Engine
This is Rietveld 408576698