Revision: 8843
Author: [email protected]
Date: Fri Aug 5 04:32:46 2011
Log: Static state cleanup: add more consts.
[email protected]
Review URL: http://codereview.chromium.org/7491052
http://code.google.com/p/v8/source/detail?r=8843
Modified:
/branches/bleeding_edge/src/arm/deoptimizer-arm.cc
/branches/bleeding_edge/src/arm/disasm-arm.cc
/branches/bleeding_edge/src/assembler.cc
/branches/bleeding_edge/src/assembler.h
/branches/bleeding_edge/src/codegen.cc
/branches/bleeding_edge/src/deoptimizer.h
/branches/bleeding_edge/src/ia32/deoptimizer-ia32.cc
/branches/bleeding_edge/src/ia32/disasm-ia32.cc
/branches/bleeding_edge/src/log-utils.cc
/branches/bleeding_edge/src/log-utils.h
/branches/bleeding_edge/src/mips/deoptimizer-mips.cc
/branches/bleeding_edge/src/scanner-base.cc
/branches/bleeding_edge/src/scanner-base.h
/branches/bleeding_edge/src/x64/deoptimizer-x64.cc
/branches/bleeding_edge/src/x64/disasm-x64.cc
=======================================
--- /branches/bleeding_edge/src/arm/deoptimizer-arm.cc Thu Jun 30 08:57:56
2011
+++ /branches/bleeding_edge/src/arm/deoptimizer-arm.cc Fri Aug 5 04:32:46
2011
@@ -35,7 +35,7 @@
namespace v8 {
namespace internal {
-int Deoptimizer::table_entry_size_ = 16;
+const int Deoptimizer::table_entry_size_ = 16;
int Deoptimizer::patch_size() {
=======================================
--- /branches/bleeding_edge/src/arm/disasm-arm.cc Mon Jul 4 01:57:43 2011
+++ /branches/bleeding_edge/src/arm/disasm-arm.cc Fri Aug 5 04:32:46 2011
@@ -200,7 +200,7 @@
// These shift names are defined in a way to match the native disassembler
// formatting. See for example the command "objdump -d <binary file>".
-static const char* shift_names[kNumberOfShifts] = {
+static const char* const shift_names[kNumberOfShifts] = {
"lsl", "lsr", "asr", "ror"
};
=======================================
--- /branches/bleeding_edge/src/assembler.cc Wed Jul 13 09:36:26 2011
+++ /branches/bleeding_edge/src/assembler.cc Fri Aug 5 04:32:46 2011
@@ -74,7 +74,7 @@
const double DoubleConstant::canonical_non_hole_nan = OS::nan_value();
const double DoubleConstant::the_hole_nan = BitCast<double>(kHoleNanInt64);
const double DoubleConstant::negative_infinity = -V8_INFINITY;
-const char* RelocInfo::kFillerCommentString = "DEOPTIMIZATION PADDING";
+const char* const RelocInfo::kFillerCommentString = "DEOPTIMIZATION
PADDING";
//
-----------------------------------------------------------------------------
// Implementation of AssemblerBase
=======================================
--- /branches/bleeding_edge/src/assembler.h Wed Jul 13 06:50:27 2011
+++ /branches/bleeding_edge/src/assembler.h Fri Aug 5 04:32:46 2011
@@ -171,7 +171,7 @@
// where we are not sure to have enough space for patching in during
// lazy deoptimization. This is the case if we have indirect calls for
which
// we do not normally record relocation info.
- static const char* kFillerCommentString;
+ static const char* const kFillerCommentString;
// The minimum size of a comment is equal to three bytes for the extra
tagged
// pc + the tag for the data, and kPointerSize for the actual pointer to
the
=======================================
--- /branches/bleeding_edge/src/codegen.cc Wed Jul 13 02:09:04 2011
+++ /branches/bleeding_edge/src/codegen.cc Fri Aug 5 04:32:46 2011
@@ -169,7 +169,6 @@
#endif // ENABLE_DISASSEMBLER
}
-static Vector<const char> kRegexp = CStrVector("regexp");
bool CodeGenerator::ShouldGenerateLog(Expression* type) {
ASSERT(type != NULL);
@@ -179,7 +178,7 @@
}
Handle<String> name = Handle<String>::cast(type->AsLiteral()->handle());
if (FLAG_log_regexp) {
- if (name->IsEqualTo(kRegexp))
+ if (name->IsEqualTo(CStrVector("regexp")))
return true;
}
return false;
=======================================
--- /branches/bleeding_edge/src/deoptimizer.h Thu Jul 7 12:27:48 2011
+++ /branches/bleeding_edge/src/deoptimizer.h Fri Aug 5 04:32:46 2011
@@ -317,7 +317,7 @@
List<HeapNumberMaterializationDescriptor> deferred_heap_numbers_;
- static int table_entry_size_;
+ static const int table_entry_size_;
friend class FrameDescription;
friend class DeoptimizingCodeListNode;
=======================================
--- /branches/bleeding_edge/src/ia32/deoptimizer-ia32.cc Thu Jun 30
08:57:56 2011
+++ /branches/bleeding_edge/src/ia32/deoptimizer-ia32.cc Fri Aug 5
04:32:46 2011
@@ -37,7 +37,7 @@
namespace v8 {
namespace internal {
-int Deoptimizer::table_entry_size_ = 10;
+const int Deoptimizer::table_entry_size_ = 10;
int Deoptimizer::patch_size() {
=======================================
--- /branches/bleeding_edge/src/ia32/disasm-ia32.cc Tue May 3 05:00:54 2011
+++ /branches/bleeding_edge/src/ia32/disasm-ia32.cc Fri Aug 5 04:32:46 2011
@@ -54,7 +54,7 @@
};
-static ByteMnemonic two_operands_instr[] = {
+static const ByteMnemonic two_operands_instr[] = {
{0x03, "add", REG_OPER_OP_ORDER},
{0x09, "or", OPER_REG_OP_ORDER},
{0x0B, "or", REG_OPER_OP_ORDER},
@@ -79,7 +79,7 @@
};
-static ByteMnemonic zero_operands_instr[] = {
+static const ByteMnemonic zero_operands_instr[] = {
{0xC3, "ret", UNSET_OP_ORDER},
{0xC9, "leave", UNSET_OP_ORDER},
{0x90, "nop", UNSET_OP_ORDER},
@@ -98,14 +98,14 @@
};
-static ByteMnemonic call_jump_instr[] = {
+static const ByteMnemonic call_jump_instr[] = {
{0xE8, "call", UNSET_OP_ORDER},
{0xE9, "jmp", UNSET_OP_ORDER},
{-1, "", UNSET_OP_ORDER}
};
-static ByteMnemonic short_immediate_instr[] = {
+static const ByteMnemonic short_immediate_instr[] = {
{0x05, "add", UNSET_OP_ORDER},
{0x0D, "or", UNSET_OP_ORDER},
{0x15, "adc", UNSET_OP_ORDER},
@@ -117,7 +117,7 @@
};
-static const char* jump_conditional_mnem[] = {
+static const char* const jump_conditional_mnem[] = {
/*0*/ "jo", "jno", "jc", "jnc",
/*4*/ "jz", "jnz", "jna", "ja",
/*8*/ "js", "jns", "jpe", "jpo",
@@ -125,7 +125,7 @@
};
-static const char* set_conditional_mnem[] = {
+static const char* const set_conditional_mnem[] = {
/*0*/ "seto", "setno", "setc", "setnc",
/*4*/ "setz", "setnz", "setna", "seta",
/*8*/ "sets", "setns", "setpe", "setpo",
@@ -133,7 +133,7 @@
};
-static const char* conditional_move_mnem[] = {
+static const char* const conditional_move_mnem[] = {
/*0*/ "cmovo", "cmovno", "cmovc", "cmovnc",
/*4*/ "cmovz", "cmovnz", "cmovna", "cmova",
/*8*/ "cmovs", "cmovns", "cmovpe", "cmovpo",
@@ -169,7 +169,7 @@
InstructionDesc instructions_[256];
void Clear();
void Init();
- void CopyTable(ByteMnemonic bm[], InstructionType type);
+ void CopyTable(const ByteMnemonic bm[], InstructionType type);
void SetTableRange(InstructionType type,
byte start,
byte end,
@@ -208,7 +208,8 @@
}
-void InstructionTable::CopyTable(ByteMnemonic bm[], InstructionType type) {
+void InstructionTable::CopyTable(const ByteMnemonic bm[],
+ InstructionType type) {
for (int i = 0; bm[i].b >= 0; i++) {
InstructionDesc* id = &instructions_[bm[i].b];
id->mnem = bm[i].mnem;
=======================================
--- /branches/bleeding_edge/src/log-utils.cc Fri Jul 22 02:59:45 2011
+++ /branches/bleeding_edge/src/log-utils.cc Fri Aug 5 04:32:46 2011
@@ -34,7 +34,7 @@
namespace internal {
-const char* Log::kLogToTemporaryFile = "&";
+const char* const Log::kLogToTemporaryFile = "&";
Log::Log(Logger* logger)
=======================================
--- /branches/bleeding_edge/src/log-utils.h Wed Jul 13 04:31:22 2011
+++ /branches/bleeding_edge/src/log-utils.h Fri Aug 5 04:32:46 2011
@@ -59,7 +59,7 @@
// This mode is only used in tests, as temporary files are automatically
// deleted on close and thus can't be accessed afterwards.
- static const char* kLogToTemporaryFile;
+ static const char* const kLogToTemporaryFile;
private:
explicit Log(Logger* logger);
=======================================
--- /branches/bleeding_edge/src/mips/deoptimizer-mips.cc Thu Jun 30
02:25:29 2011
+++ /branches/bleeding_edge/src/mips/deoptimizer-mips.cc Fri Aug 5
04:32:46 2011
@@ -39,7 +39,7 @@
namespace internal {
-int Deoptimizer::table_entry_size_ = 10;
+const int Deoptimizer::table_entry_size_ = 10;
int Deoptimizer::patch_size() {
=======================================
--- /branches/bleeding_edge/src/scanner-base.cc Fri Aug 5 04:21:04 2011
+++ /branches/bleeding_edge/src/scanner-base.cc Fri Aug 5 04:32:46 2011
@@ -788,7 +788,7 @@
//
----------------------------------------------------------------------------
// Keyword Matcher
-KeywordMatcher::FirstState KeywordMatcher::first_states_[] = {
+const KeywordMatcher::FirstState KeywordMatcher::first_states_[] = {
{ "break", KEYWORD_PREFIX, Token::BREAK },
{ NULL, C, Token::ILLEGAL },
{ NULL, D, Token::ILLEGAL },
=======================================
--- /branches/bleeding_edge/src/scanner-base.h Wed Jul 6 02:15:10 2011
+++ /branches/bleeding_edge/src/scanner-base.h Fri Aug 5 04:32:46 2011
@@ -633,7 +633,7 @@
static const unsigned int kFirstCharRangeLength =
kFirstCharRangeMax - kFirstCharRangeMin + 1;
// State map for first keyword character range.
- static FirstState first_states_[kFirstCharRangeLength];
+ static const FirstState first_states_[kFirstCharRangeLength];
// If input equals keyword's character at position, continue matching
keyword
// from that position.
=======================================
--- /branches/bleeding_edge/src/x64/deoptimizer-x64.cc Wed Jul 20 01:09:58
2011
+++ /branches/bleeding_edge/src/x64/deoptimizer-x64.cc Fri Aug 5 04:32:46
2011
@@ -38,7 +38,7 @@
namespace internal {
-int Deoptimizer::table_entry_size_ = 10;
+const int Deoptimizer::table_entry_size_ = 10;
int Deoptimizer::patch_size() {
=======================================
--- /branches/bleeding_edge/src/x64/disasm-x64.cc Tue Jun 21 06:57:03 2011
+++ /branches/bleeding_edge/src/x64/disasm-x64.cc Fri Aug 5 04:32:46 2011
@@ -58,7 +58,7 @@
};
-static ByteMnemonic two_operands_instr[] = {
+static const ByteMnemonic two_operands_instr[] = {
{ 0x00, BYTE_OPER_REG_OP_ORDER, "add" },
{ 0x01, OPER_REG_OP_ORDER, "add" },
{ 0x02, BYTE_REG_OPER_OP_ORDER, "add" },
@@ -105,7 +105,7 @@
};
-static ByteMnemonic zero_operands_instr[] = {
+static const ByteMnemonic zero_operands_instr[] = {
{ 0xC3, UNSET_OP_ORDER, "ret" },
{ 0xC9, UNSET_OP_ORDER, "leave" },
{ 0xF4, UNSET_OP_ORDER, "hlt" },
@@ -125,14 +125,14 @@
};
-static ByteMnemonic call_jump_instr[] = {
+static const ByteMnemonic call_jump_instr[] = {
{ 0xE8, UNSET_OP_ORDER, "call" },
{ 0xE9, UNSET_OP_ORDER, "jmp" },
{ -1, UNSET_OP_ORDER, "" }
};
-static ByteMnemonic short_immediate_instr[] = {
+static const ByteMnemonic short_immediate_instr[] = {
{ 0x05, UNSET_OP_ORDER, "add" },
{ 0x0D, UNSET_OP_ORDER, "or" },
{ 0x15, UNSET_OP_ORDER, "adc" },
@@ -145,7 +145,7 @@
};
-static const char* conditional_code_suffix[] = {
+static const char* const conditional_code_suffix[] = {
"o", "no", "c", "nc", "z", "nz", "na", "a",
"s", "ns", "pe", "po", "l", "ge", "le", "g"
};
@@ -193,7 +193,7 @@
InstructionDesc instructions_[256];
void Clear();
void Init();
- void CopyTable(ByteMnemonic bm[], InstructionType type);
+ void CopyTable(const ByteMnemonic bm[], InstructionType type);
void SetTableRange(InstructionType type, byte start, byte end, bool
byte_size,
const char* mnem);
void AddJumpConditionalShort();
@@ -228,7 +228,8 @@
}
-void InstructionTable::CopyTable(ByteMnemonic bm[], InstructionType type) {
+void InstructionTable::CopyTable(const ByteMnemonic bm[],
+ InstructionType type) {
for (int i = 0; bm[i].b >= 0; i++) {
InstructionDesc* id = &instructions_[bm[i].b];
id->mnem = bm[i].mnem;
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev