Revision: 3807
Author: [email protected]
Date: Fri Feb 5 05:07:00 2010
Log: Fix test failures in debug mode w/snapshots. It turns out that not
all stubs have valid major_keys, and this is OK. So I've added
a check to avoid termination in debug mode.
Review URL: http://codereview.chromium.org/572034
http://code.google.com/p/v8/source/detail?r=3807
Modified:
/branches/bleeding_edge/src/code-stubs.cc
/branches/bleeding_edge/src/code-stubs.h
/branches/bleeding_edge/src/disassembler.cc
/branches/bleeding_edge/src/log.cc
=======================================
--- /branches/bleeding_edge/src/code-stubs.cc Wed Dec 9 06:54:34 2009
+++ /branches/bleeding_edge/src/code-stubs.cc Fri Feb 5 05:07:00 2010
@@ -149,13 +149,16 @@
}
-const char* CodeStub::MajorName(CodeStub::Major major_key) {
+const char* CodeStub::MajorName(CodeStub::Major major_key,
+ bool allow_unknown_keys) {
switch (major_key) {
#define DEF_CASE(name) case name: return #name;
CODE_STUB_LIST(DEF_CASE)
#undef DEF_CASE
default:
- UNREACHABLE();
+ if (!allow_unknown_keys) {
+ UNREACHABLE();
+ }
return NULL;
}
}
=======================================
--- /branches/bleeding_edge/src/code-stubs.h Fri Jan 29 04:41:11 2010
+++ /branches/bleeding_edge/src/code-stubs.h Fri Feb 5 05:07:00 2010
@@ -100,7 +100,7 @@
static int MinorKeyFromKey(uint32_t key) {
return MinorKeyBits::decode(key);
};
- static const char* MajorName(Major major_key);
+ static const char* MajorName(Major major_key, bool allow_unknown_keys);
virtual ~CodeStub() {}
@@ -138,7 +138,7 @@
virtual InLoopFlag InLoop() { return NOT_IN_LOOP; }
// Returns a name for logging/debugging purposes.
- virtual const char* GetName() { return MajorName(MajorKey()); }
+ virtual const char* GetName() { return MajorName(MajorKey(), false); }
#ifdef DEBUG
virtual void Print() { PrintF("%s\n", GetName()); }
=======================================
--- /branches/bleeding_edge/src/disassembler.cc Fri Jan 29 04:41:11 2010
+++ /branches/bleeding_edge/src/disassembler.cc Fri Feb 5 05:07:00 2010
@@ -261,7 +261,7 @@
ASSERT(code->major_key() == CodeStub::MajorKeyFromKey(key));
out.AddFormatted(" %s, %s, ",
Code::Kind2String(kind),
- CodeStub::MajorName(code->major_key()));
+ CodeStub::MajorName(code->major_key(),
false));
switch (code->major_key()) {
case CodeStub::CallFunction:
out.AddFormatted("argc = %d", minor_key);
=======================================
--- /branches/bleeding_edge/src/log.cc Thu Feb 4 13:34:03 2010
+++ /branches/bleeding_edge/src/log.cc Fri Feb 5 05:07:00 2010
@@ -1261,7 +1261,9 @@
case Code::FUNCTION:
return; // We log this later using LogCompiledFunctions.
case Code::STUB:
- description = CodeStub::MajorName(code_object->major_key());
+ description = CodeStub::MajorName(code_object->major_key(), true);
+ if (description == NULL)
+ description = "A stub from the snapshot";
tag = Logger::STUB_TAG;
break;
case Code::BUILTIN:
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev