Cleaned up and fixed code comment handling a bit.

* Let GCC check the arguments of LCodeGen::Coment.
* Fixed a few call sites.
* Made basic blocks a little bit more visible in the code output.
* Sorted #includes.

Review URL: https://codereview.chromium.org/14079007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14331 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 373bdbc9
......@@ -304,7 +304,7 @@ bool LCodeGen::GenerateDeferredCode() {
LDeferredCode* code = deferred_[i];
__ bind(code->entry());
if (NeedsDeferredFrame()) {
Comment(";;; Deferred build frame",
Comment(";;; Deferred build frame @%d: %s.",
code->instruction_index(),
code->instr()->Mnemonic());
ASSERT(!frame_is_built_);
......@@ -320,7 +320,7 @@ bool LCodeGen::GenerateDeferredCode() {
code->instr()->Mnemonic());
code->Generate();
if (NeedsDeferredFrame()) {
Comment(";;; Deferred destroy frame",
Comment(";;; Deferred destroy frame @%d: %s.",
code->instruction_index(),
code->instr()->Mnemonic());
ASSERT(frame_is_built_);
......@@ -1043,11 +1043,9 @@ void LCodeGen::RecordPosition(int position) {
void LCodeGen::DoLabel(LLabel* label) {
if (label->is_loop_header()) {
Comment(";;; B%d - LOOP entry", label->block_id());
} else {
Comment(";;; B%d", label->block_id());
}
Comment(";;; -------------------- B%d%s --------------------",
label->block_id(),
label->is_loop_header() ? " (loop header)" : "");
__ bind(label->label());
current_block_ = label->block_id();
DoGap(label);
......
......@@ -29,10 +29,12 @@
#define V8_ARM_LITHIUM_CODEGEN_ARM_H_
#include "arm/lithium-arm.h"
#include "arm/lithium-gap-resolver-arm.h"
#include "deoptimizer.h"
#include "safepoint-table.h"
#include "scopes.h"
#include "v8utils.h"
namespace v8 {
namespace internal {
......@@ -211,7 +213,7 @@ class LCodeGen BASE_EMBEDDED {
int GetStackSlotCount() const { return chunk()->spill_slot_count(); }
void Abort(const char* reason);
void Comment(const char* format, ...);
void FPRINTF_CHECKING Comment(const char* format, ...);
void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code, zone()); }
......
......@@ -467,7 +467,7 @@ bool LCodeGen::GenerateDeferredCode() {
LDeferredCode* code = deferred_[i];
__ bind(code->entry());
if (NeedsDeferredFrame()) {
Comment(";;; Deferred build frame",
Comment(";;; Deferred build frame @%d: %s.",
code->instruction_index(),
code->instr()->Mnemonic());
ASSERT(!frame_is_built_);
......@@ -484,7 +484,7 @@ bool LCodeGen::GenerateDeferredCode() {
code->instr()->Mnemonic());
code->Generate();
if (NeedsDeferredFrame()) {
Comment(";;; Deferred destroy frame",
Comment(";;; Deferred destroy frame @%d: %s.",
code->instruction_index(),
code->instr()->Mnemonic());
ASSERT(frame_is_built_);
......@@ -1126,11 +1126,9 @@ void LCodeGen::RecordPosition(int position) {
void LCodeGen::DoLabel(LLabel* label) {
if (label->is_loop_header()) {
Comment(";;; B%d - LOOP entry", label->block_id());
} else {
Comment(";;; B%d", label->block_id());
}
Comment(";;; -------------------- B%d%s --------------------",
label->block_id(),
label->is_loop_header() ? " (loop header)" : "");
__ bind(label->label());
current_block_ = label->block_id();
DoGap(label);
......
......@@ -32,9 +32,10 @@
#include "checks.h"
#include "deoptimizer.h"
#include "ia32/lithium-gap-resolver-ia32.h"
#include "safepoint-table.h"
#include "scopes.h"
#include "ia32/lithium-gap-resolver-ia32.h"
#include "v8utils.h"
namespace v8 {
namespace internal {
......@@ -201,7 +202,7 @@ class LCodeGen BASE_EMBEDDED {
int GetStackSlotCount() const { return chunk()->spill_slot_count(); }
void Abort(const char* reason);
void Comment(const char* format, ...);
void FPRINTF_CHECKING Comment(const char* format, ...);
void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code, zone()); }
......
......@@ -301,7 +301,7 @@ bool LCodeGen::GenerateDeferredCode() {
LDeferredCode* code = deferred_[i];
__ bind(code->entry());
if (NeedsDeferredFrame()) {
Comment(";;; Deferred build frame",
Comment(";;; Deferred build frame @%d: %s.",
code->instruction_index(),
code->instr()->Mnemonic());
ASSERT(!frame_is_built_);
......@@ -317,7 +317,7 @@ bool LCodeGen::GenerateDeferredCode() {
code->instr()->Mnemonic());
code->Generate();
if (NeedsDeferredFrame()) {
Comment(";;; Deferred destroy frame",
Comment(";;; Deferred destroy frame @%d: %s.",
code->instruction_index(),
code->instr()->Mnemonic());
ASSERT(frame_is_built_);
......@@ -1024,11 +1024,9 @@ void LCodeGen::RecordPosition(int position) {
void LCodeGen::DoLabel(LLabel* label) {
if (label->is_loop_header()) {
Comment(";;; B%d - LOOP entry", label->block_id());
} else {
Comment(";;; B%d", label->block_id());
}
Comment(";;; -------------------- B%d%s --------------------",
label->block_id(),
label->is_loop_header() ? " (loop header)" : "");
__ bind(label->label());
current_block_ = label->block_id();
DoGap(label);
......
......@@ -28,11 +28,12 @@
#ifndef V8_MIPS_LITHIUM_CODEGEN_MIPS_H_
#define V8_MIPS_LITHIUM_CODEGEN_MIPS_H_
#include "mips/lithium-mips.h"
#include "mips/lithium-gap-resolver-mips.h"
#include "deoptimizer.h"
#include "mips/lithium-gap-resolver-mips.h"
#include "mips/lithium-mips.h"
#include "safepoint-table.h"
#include "scopes.h"
#include "v8utils.h"
namespace v8 {
namespace internal {
......@@ -207,7 +208,7 @@ class LCodeGen BASE_EMBEDDED {
int GetStackSlotCount() const { return chunk()->spill_slot_count(); }
void Abort(const char* reason);
void Comment(const char* format, ...);
void FPRINTF_CHECKING Comment(const char* format, ...);
void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code, zone()); }
......
......@@ -370,7 +370,7 @@ bool LCodeGen::GenerateDeferredCode() {
LDeferredCode* code = deferred_[i];
__ bind(code->entry());
if (NeedsDeferredFrame()) {
Comment(";;; Deferred build frame",
Comment(";;; Deferred build frame @%d: %s.",
code->instruction_index(),
code->instr()->Mnemonic());
ASSERT(!frame_is_built_);
......@@ -387,7 +387,7 @@ bool LCodeGen::GenerateDeferredCode() {
code->instr()->Mnemonic());
code->Generate();
if (NeedsDeferredFrame()) {
Comment(";;; Deferred destroy frame",
Comment(";;; Deferred destroy frame @%d: %s.",
code->instruction_index(),
code->instr()->Mnemonic());
ASSERT(frame_is_built_);
......@@ -926,11 +926,9 @@ void LCodeGen::RecordPosition(int position) {
void LCodeGen::DoLabel(LLabel* label) {
if (label->is_loop_header()) {
Comment(";;; B%d - LOOP entry", label->block_id());
} else {
Comment(";;; B%d", label->block_id());
}
Comment(";;; -------------------- B%d%s --------------------",
label->block_id(),
label->is_loop_header() ? " (loop header)" : "");
__ bind(label->label());
current_block_ = label->block_id();
DoGap(label);
......
......@@ -34,6 +34,7 @@
#include "deoptimizer.h"
#include "safepoint-table.h"
#include "scopes.h"
#include "v8utils.h"
#include "x64/lithium-gap-resolver-x64.h"
namespace v8 {
......@@ -172,7 +173,7 @@ class LCodeGen BASE_EMBEDDED {
int GetStackSlotCount() const { return chunk()->spill_slot_count(); }
void Abort(const char* reason);
void Comment(const char* format, ...);
void FPRINTF_CHECKING Comment(const char* format, ...);
void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code, zone()); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment