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

Unified Diff: src/IceAssembler.cpp

Issue 1197863003: Subzero: Reduce the amount of #ifdef'd code. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Cleanup Created 5 years, 6 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
« no previous file with comments | « src/IceAssembler.h ('k') | src/IceAssemblerX8632.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceAssembler.cpp
diff --git a/src/IceAssembler.cpp b/src/IceAssembler.cpp
index e160612bad75853efd84be1cec45cb2db3b65bf2..757c3ea80b72f5f6b2e248d65e594de0024a0a33 100644
--- a/src/IceAssembler.cpp
+++ b/src/IceAssembler.cpp
@@ -45,15 +45,11 @@ AssemblerFixup *AssemblerBuffer::createFixup(FixupKind Kind,
return F;
}
-#ifndef NDEBUG
-AssemblerBuffer::EnsureCapacity::EnsureCapacity(AssemblerBuffer *buffer) {
- if (buffer->cursor() >= buffer->limit())
- buffer->extendCapacity();
+void AssemblerBuffer::EnsureCapacity::validate(AssemblerBuffer *buffer) {
// In debug mode, we save the assembler buffer along with the gap
// size before we start emitting to the buffer. This allows us to
// check that any single generated instruction doesn't overflow the
// limit implied by the minimum gap size.
- Buffer = buffer;
Gap = computeGap();
// Make sure that extending the capacity leaves a big enough gap
// for any kind of instruction.
@@ -69,9 +65,9 @@ AssemblerBuffer::EnsureCapacity::~EnsureCapacity() {
// Make sure the generated instruction doesn't take up more
// space than the minimum gap.
intptr_t delta = Gap - computeGap();
+ (void)delta;
assert(delta <= kMinimumGap);
}
-#endif // !NDEBUG
AssemblerBuffer::AssemblerBuffer(Assembler &Asm) : Assemblr(Asm) {
const intptr_t OneKB = 1024;
@@ -79,9 +75,7 @@ AssemblerBuffer::AssemblerBuffer(Assembler &Asm) : Assemblr(Asm) {
Contents = NewContents(Assemblr, kInitialBufferCapacity);
Cursor = Contents;
Limit = computeLimit(Contents, kInitialBufferCapacity);
-#ifndef NDEBUG
HasEnsuredCapacity = false;
-#endif // !NDEBUG
// Verify internal state.
assert(capacity() == kInitialBufferCapacity);
« no previous file with comments | « src/IceAssembler.h ('k') | src/IceAssemblerX8632.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698