Abolish kDebug and use ifdef DEBUG throughout for consistency.

Review URL: http://codereview.chromium.org/94001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1761 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
erik.corry@gmail.com 2009-04-22 09:25:41 +00:00
parent 3b84a19bfe
commit f78fbf0c56
6 changed files with 40 additions and 40 deletions

View File

@ -319,9 +319,11 @@ Assembler::Assembler(void* buffer, int buffer_size) {
// Clear the buffer in debug mode unless it was provided by the
// caller in which case we can't be sure it's okay to overwrite
// existing code in it; see CodePatcher::CodePatcher(...).
if (kDebug && own_buffer_) {
#ifdef DEBUG
if (own_buffer_) {
memset(buffer_, 0xCC, buffer_size); // int3
}
#endif
// setup buffer pointers
ASSERT(buffer_ != NULL);
@ -2080,9 +2082,9 @@ void Assembler::GrowBuffer() {
// Clear the buffer in debug mode. Use 'int3' instructions to make
// sure to get into problems if we ever run uninitialized code.
if (kDebug) {
#ifdef DEBUG
memset(desc.buffer, 0xCC, desc.buffer_size);
}
#endif
// copy the data
int pc_delta = desc.buffer - buffer_;

View File

@ -147,13 +147,13 @@ void CodeGenerator::GenCode(FunctionLiteral* fun) {
frame_->EmitPush(r0);
frame_->CallRuntime(Runtime::kNewContext, 1); // r0 holds the result
if (kDebug) {
#ifdef DEBUG
JumpTarget verified_true(this);
__ cmp(r0, Operand(cp));
verified_true.Branch(eq);
__ stop("NewContext: r0 is expected to be the same as cp");
verified_true.Bind();
}
#endif
// Update context local.
__ str(cp, frame_->Context());
}
@ -1423,13 +1423,13 @@ void CodeGenerator::VisitWithEnterStatement(WithEnterStatement* node) {
} else {
frame_->CallRuntime(Runtime::kPushContext, 1);
}
if (kDebug) {
#ifdef DEBUG
JumpTarget verified_true(this);
__ cmp(r0, Operand(cp));
verified_true.Branch(eq);
__ stop("PushContext: r0 is expected to be the same as cp");
verified_true.Bind();
}
#endif
// Update context local.
__ str(cp, frame_->Context());
ASSERT(frame_->height() == original_height);
@ -4656,9 +4656,11 @@ void CEntryStub::GenerateThrowTOS(MacroAssembler* masm) {
__ mov(cp, Operand(0), LeaveCC, eq);
// Restore cp otherwise.
__ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset), ne);
if (kDebug && FLAG_debug_code) {
#ifdef DEBUG
if (FLAG_debug_code) {
__ mov(lr, Operand(pc));
}
#endif
__ pop(pc);
}
@ -4721,9 +4723,11 @@ void CEntryStub::GenerateThrowOutOfMemory(MacroAssembler* masm) {
__ mov(cp, Operand(0), LeaveCC, eq);
// Restore cp otherwise.
__ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset), ne);
if (kDebug && FLAG_debug_code) {
#ifdef DEBUG
if (FLAG_debug_code) {
__ mov(lr, Operand(pc));
}
#endif
__ pop(pc);
}

View File

@ -647,10 +647,10 @@ void EntryFrame::Iterate(ObjectVisitor* v) const {
handler->Iterate(v);
// Make sure that there's the entry frame does not contain more than
// one stack handler.
if (kDebug) {
#ifdef DEBUG
it.Advance();
ASSERT(it.done());
}
#endif
}

View File

@ -80,12 +80,6 @@ typedef signed int uc32;
// -----------------------------------------------------------------------------
// Constants
#ifdef DEBUG
const bool kDebug = true;
#else
const bool kDebug = false;
#endif // DEBUG
const int KB = 1024;
const int MB = KB * KB;
const int GB = KB * KB * KB;

View File

@ -352,9 +352,9 @@ void MacroAssembler::LeaveExitFrame(StackFrame::Type type) {
// Restore current context from top and clear it in debug mode.
mov(ip, Operand(ExternalReference(Top::k_context_address)));
ldr(cp, MemOperand(ip));
if (kDebug) {
#ifdef DEBUG
str(r3, MemOperand(ip));
}
#endif
// Pop the arguments, restore registers, and return.
mov(sp, Operand(fp)); // respect ABI stack constraint
@ -679,10 +679,10 @@ void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg,
// Load current lexical context from the stack frame.
ldr(scratch, MemOperand(fp, StandardFrameConstants::kContextOffset));
// In debug mode, make sure the lexical context is set.
if (kDebug) {
#ifdef DEBUG
cmp(scratch, Operand(0));
Check(ne, "we should not have an empty lexical context");
}
#endif
// Load the global context of the current context.
int offset = Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize;

View File

@ -432,9 +432,9 @@ void MacroAssembler::LeaveExitFrame(StackFrame::Type type) {
// Restore current context from top and clear it in debug mode.
ExternalReference context_address(Top::k_context_address);
mov(esi, Operand::StaticVariable(context_address));
if (kDebug) {
#ifdef DEBUG
mov(Operand::StaticVariable(context_address), Immediate(0));
}
#endif
// Push the return address to get ready to return.
push(ecx);