Removed useless implementations of GetName and Print for code stubs, the common

super-class handles the most common case already.
Review URL: http://codereview.chromium.org/7332001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8576 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 562adac5
...@@ -304,12 +304,6 @@ class ConvertToDoubleStub : public CodeStub { ...@@ -304,12 +304,6 @@ class ConvertToDoubleStub : public CodeStub {
} }
void Generate(MacroAssembler* masm); void Generate(MacroAssembler* masm);
const char* GetName() { return "ConvertToDoubleStub"; }
#ifdef DEBUG
void Print() { PrintF("ConvertToDoubleStub\n"); }
#endif
}; };
......
...@@ -78,7 +78,7 @@ class UnaryOpStub: public CodeStub { ...@@ -78,7 +78,7 @@ class UnaryOpStub: public CodeStub {
char* name_; char* name_;
const char* GetName(); virtual const char* GetName();
#ifdef DEBUG #ifdef DEBUG
void Print() { void Print() {
...@@ -175,7 +175,7 @@ class BinaryOpStub: public CodeStub { ...@@ -175,7 +175,7 @@ class BinaryOpStub: public CodeStub {
char* name_; char* name_;
const char* GetName(); virtual const char* GetName();
#ifdef DEBUG #ifdef DEBUG
void Print() { void Print() {
...@@ -370,12 +370,6 @@ class WriteInt32ToHeapNumberStub : public CodeStub { ...@@ -370,12 +370,6 @@ class WriteInt32ToHeapNumberStub : public CodeStub {
} }
void Generate(MacroAssembler* masm); void Generate(MacroAssembler* masm);
const char* GetName() { return "WriteInt32ToHeapNumberStub"; }
#ifdef DEBUG
void Print() { PrintF("WriteInt32ToHeapNumberStub\n"); }
#endif
}; };
...@@ -402,8 +396,6 @@ class NumberToStringStub: public CodeStub { ...@@ -402,8 +396,6 @@ class NumberToStringStub: public CodeStub {
int MinorKey() { return 0; } int MinorKey() { return 0; }
void Generate(MacroAssembler* masm); void Generate(MacroAssembler* masm);
const char* GetName() { return "NumberToStringStub"; }
}; };
...@@ -421,8 +413,6 @@ class RegExpCEntryStub: public CodeStub { ...@@ -421,8 +413,6 @@ class RegExpCEntryStub: public CodeStub {
int MinorKey() { return 0; } int MinorKey() { return 0; }
bool NeedsImmovableCode() { return true; } bool NeedsImmovableCode() { return true; }
const char* GetName() { return "RegExpCEntryStub"; }
}; };
...@@ -443,8 +433,6 @@ class DirectCEntryStub: public CodeStub { ...@@ -443,8 +433,6 @@ class DirectCEntryStub: public CodeStub {
int MinorKey() { return 0; } int MinorKey() { return 0; }
bool NeedsImmovableCode() { return true; } bool NeedsImmovableCode() { return true; }
const char* GetName() { return "DirectCEntryStub"; }
}; };
...@@ -627,13 +615,6 @@ class StringDictionaryLookupStub: public CodeStub { ...@@ -627,13 +615,6 @@ class StringDictionaryLookupStub: public CodeStub {
StringDictionary::kHeaderSize + StringDictionary::kHeaderSize +
StringDictionary::kElementsStartIndex * kPointerSize; StringDictionary::kElementsStartIndex * kPointerSize;
#ifdef DEBUG
void Print() {
PrintF("StringDictionaryLookupStub\n");
}
#endif
Major MajorKey() { return StringDictionaryNegativeLookup; } Major MajorKey() { return StringDictionaryNegativeLookup; }
int MinorKey() { int MinorKey() {
......
...@@ -170,7 +170,7 @@ MaybeObject* CodeStub::TryGetCode() { ...@@ -170,7 +170,7 @@ MaybeObject* CodeStub::TryGetCode() {
const char* CodeStub::MajorName(CodeStub::Major major_key, const char* CodeStub::MajorName(CodeStub::Major major_key,
bool allow_unknown_keys) { bool allow_unknown_keys) {
switch (major_key) { switch (major_key) {
#define DEF_CASE(name) case name: return #name; #define DEF_CASE(name) case name: return #name "Stub";
CODE_STUB_LIST(DEF_CASE) CODE_STUB_LIST(DEF_CASE)
#undef DEF_CASE #undef DEF_CASE
default: default:
......
...@@ -189,7 +189,7 @@ class CodeStub BASE_EMBEDDED { ...@@ -189,7 +189,7 @@ class CodeStub BASE_EMBEDDED {
// a fixed (non-moveable) code object. // a fixed (non-moveable) code object.
virtual bool NeedsImmovableCode() { return false; } virtual bool NeedsImmovableCode() { return false; }
#ifdef DEBUG #ifdef DEBUG
virtual void Print() { PrintF("%s\n", GetName()); } virtual void Print() { PrintF("%s\n", GetName()); }
#endif #endif
...@@ -274,8 +274,6 @@ class StackCheckStub : public CodeStub { ...@@ -274,8 +274,6 @@ class StackCheckStub : public CodeStub {
void Generate(MacroAssembler* masm); void Generate(MacroAssembler* masm);
private: private:
const char* GetName() { return "StackCheckStub"; }
Major MajorKey() { return StackCheck; } Major MajorKey() { return StackCheck; }
int MinorKey() { return 0; } int MinorKey() { return 0; }
}; };
...@@ -290,7 +288,6 @@ class ToNumberStub: public CodeStub { ...@@ -290,7 +288,6 @@ class ToNumberStub: public CodeStub {
private: private:
Major MajorKey() { return ToNumber; } Major MajorKey() { return ToNumber; }
int MinorKey() { return 0; } int MinorKey() { return 0; }
const char* GetName() { return "ToNumberStub"; }
}; };
...@@ -302,7 +299,6 @@ class FastNewClosureStub : public CodeStub { ...@@ -302,7 +299,6 @@ class FastNewClosureStub : public CodeStub {
void Generate(MacroAssembler* masm); void Generate(MacroAssembler* masm);
private: private:
const char* GetName() { return "FastNewClosureStub"; }
Major MajorKey() { return FastNewClosure; } Major MajorKey() { return FastNewClosure; }
int MinorKey() { return strict_mode_; } int MinorKey() { return strict_mode_; }
...@@ -323,7 +319,6 @@ class FastNewContextStub : public CodeStub { ...@@ -323,7 +319,6 @@ class FastNewContextStub : public CodeStub {
private: private:
int slots_; int slots_;
const char* GetName() { return "FastNewContextStub"; }
Major MajorKey() { return FastNewContext; } Major MajorKey() { return FastNewContext; }
int MinorKey() { return slots_; } int MinorKey() { return slots_; }
}; };
...@@ -352,7 +347,6 @@ class FastCloneShallowArrayStub : public CodeStub { ...@@ -352,7 +347,6 @@ class FastCloneShallowArrayStub : public CodeStub {
Mode mode_; Mode mode_;
int length_; int length_;
const char* GetName() { return "FastCloneShallowArrayStub"; }
Major MajorKey() { return FastCloneShallowArray; } Major MajorKey() { return FastCloneShallowArray; }
int MinorKey() { int MinorKey() {
ASSERT(mode_ == 0 || mode_ == 1); ASSERT(mode_ == 0 || mode_ == 1);
...@@ -393,7 +387,7 @@ class InstanceofStub: public CodeStub { ...@@ -393,7 +387,7 @@ class InstanceofStub: public CodeStub {
return (flags_ & kReturnTrueFalseObject) != 0; return (flags_ & kReturnTrueFalseObject) != 0;
} }
const char* GetName(); virtual const char* GetName();
Flags flags_; Flags flags_;
char* name_; char* name_;
...@@ -408,8 +402,6 @@ class MathPowStub: public CodeStub { ...@@ -408,8 +402,6 @@ class MathPowStub: public CodeStub {
private: private:
virtual CodeStub::Major MajorKey() { return MathPow; } virtual CodeStub::Major MajorKey() { return MathPow; }
virtual int MinorKey() { return 0; } virtual int MinorKey() { return 0; }
const char* GetName() { return "MathPowStub"; }
}; };
...@@ -544,7 +536,7 @@ class CompareStub: public CodeStub { ...@@ -544,7 +536,7 @@ class CompareStub: public CodeStub {
// Unfortunately you have to run without snapshots to see most of these // Unfortunately you have to run without snapshots to see most of these
// names in the profile since most compare stubs end up in the snapshot. // names in the profile since most compare stubs end up in the snapshot.
char* name_; char* name_;
const char* GetName(); virtual const char* GetName();
#ifdef DEBUG #ifdef DEBUG
void Print() { void Print() {
PrintF("CompareStub (minor %d) (cc %d), (strict %s), " PrintF("CompareStub (minor %d) (cc %d), (strict %s), "
...@@ -593,8 +585,6 @@ class CEntryStub : public CodeStub { ...@@ -593,8 +585,6 @@ class CEntryStub : public CodeStub {
int MinorKey(); int MinorKey();
bool NeedsImmovableCode(); bool NeedsImmovableCode();
const char* GetName() { return "CEntryStub"; }
}; };
...@@ -610,8 +600,6 @@ class JSEntryStub : public CodeStub { ...@@ -610,8 +600,6 @@ class JSEntryStub : public CodeStub {
private: private:
Major MajorKey() { return JSEntry; } Major MajorKey() { return JSEntry; }
int MinorKey() { return 0; } int MinorKey() { return 0; }
const char* GetName() { return "JSEntryStub"; }
}; };
...@@ -624,7 +612,7 @@ class JSConstructEntryStub : public JSEntryStub { ...@@ -624,7 +612,7 @@ class JSConstructEntryStub : public JSEntryStub {
private: private:
int MinorKey() { return 1; } int MinorKey() { return 1; }
const char* GetName() { return "JSConstructEntryStub"; } virtual const char* GetName() { return "JSConstructEntryStub"; }
}; };
...@@ -651,8 +639,6 @@ class ArgumentsAccessStub: public CodeStub { ...@@ -651,8 +639,6 @@ class ArgumentsAccessStub: public CodeStub {
void GenerateNewNonStrictFast(MacroAssembler* masm); void GenerateNewNonStrictFast(MacroAssembler* masm);
void GenerateNewNonStrictSlow(MacroAssembler* masm); void GenerateNewNonStrictSlow(MacroAssembler* masm);
const char* GetName() { return "ArgumentsAccessStub"; }
#ifdef DEBUG #ifdef DEBUG
void Print() { void Print() {
PrintF("ArgumentsAccessStub (type %d)\n", type_); PrintF("ArgumentsAccessStub (type %d)\n", type_);
...@@ -670,14 +656,6 @@ class RegExpExecStub: public CodeStub { ...@@ -670,14 +656,6 @@ class RegExpExecStub: public CodeStub {
int MinorKey() { return 0; } int MinorKey() { return 0; }
void Generate(MacroAssembler* masm); void Generate(MacroAssembler* masm);
const char* GetName() { return "RegExpExecStub"; }
#ifdef DEBUG
void Print() {
PrintF("RegExpExecStub\n");
}
#endif
}; };
...@@ -690,14 +668,6 @@ class RegExpConstructResultStub: public CodeStub { ...@@ -690,14 +668,6 @@ class RegExpConstructResultStub: public CodeStub {
int MinorKey() { return 0; } int MinorKey() { return 0; }
void Generate(MacroAssembler* masm); void Generate(MacroAssembler* masm);
const char* GetName() { return "RegExpConstructResultStub"; }
#ifdef DEBUG
void Print() {
PrintF("RegExpConstructResultStub\n");
}
#endif
}; };
...@@ -921,12 +891,6 @@ class AllowStubCallsScope { ...@@ -921,12 +891,6 @@ class AllowStubCallsScope {
DISALLOW_COPY_AND_ASSIGN(AllowStubCallsScope); DISALLOW_COPY_AND_ASSIGN(AllowStubCallsScope);
}; };
#ifdef DEBUG
#define DECLARE_ARRAY_STUB_PRINT(name) void Print() { PrintF(#name); }
#else
#define DECLARE_ARRAY_STUB_PRINT(name)
#endif
class KeyedLoadFastElementStub : public CodeStub { class KeyedLoadFastElementStub : public CodeStub {
public: public:
...@@ -937,10 +901,6 @@ class KeyedLoadFastElementStub : public CodeStub { ...@@ -937,10 +901,6 @@ class KeyedLoadFastElementStub : public CodeStub {
int MinorKey() { return 0; } int MinorKey() { return 0; }
void Generate(MacroAssembler* masm); void Generate(MacroAssembler* masm);
const char* GetName() { return "KeyedLoadFastElementStub"; }
DECLARE_ARRAY_STUB_PRINT(KeyedLoadFastElementStub)
}; };
...@@ -954,10 +914,6 @@ class KeyedStoreFastElementStub : public CodeStub { ...@@ -954,10 +914,6 @@ class KeyedStoreFastElementStub : public CodeStub {
void Generate(MacroAssembler* masm); void Generate(MacroAssembler* masm);
const char* GetName() { return "KeyedStoreFastElementStub"; }
DECLARE_ARRAY_STUB_PRINT(KeyedStoreFastElementStub)
private: private:
bool is_js_array_; bool is_js_array_;
}; };
...@@ -973,10 +929,6 @@ class KeyedLoadExternalArrayStub : public CodeStub { ...@@ -973,10 +929,6 @@ class KeyedLoadExternalArrayStub : public CodeStub {
void Generate(MacroAssembler* masm); void Generate(MacroAssembler* masm);
const char* GetName() { return "KeyedLoadExternalArrayStub"; }
DECLARE_ARRAY_STUB_PRINT(KeyedLoadExternalArrayStub)
protected: protected:
JSObject::ElementsKind elements_kind_; JSObject::ElementsKind elements_kind_;
}; };
...@@ -992,10 +944,6 @@ class KeyedStoreExternalArrayStub : public CodeStub { ...@@ -992,10 +944,6 @@ class KeyedStoreExternalArrayStub : public CodeStub {
void Generate(MacroAssembler* masm); void Generate(MacroAssembler* masm);
const char* GetName() { return "KeyedStoreExternalArrayStub"; }
DECLARE_ARRAY_STUB_PRINT(KeyedStoreExternalArrayStub)
protected: protected:
JSObject::ElementsKind elements_kind_; JSObject::ElementsKind elements_kind_;
}; };
......
...@@ -80,7 +80,7 @@ class UnaryOpStub: public CodeStub { ...@@ -80,7 +80,7 @@ class UnaryOpStub: public CodeStub {
char* name_; char* name_;
const char* GetName(); virtual const char* GetName();
#ifdef DEBUG #ifdef DEBUG
void Print() { void Print() {
...@@ -186,7 +186,7 @@ class BinaryOpStub: public CodeStub { ...@@ -186,7 +186,7 @@ class BinaryOpStub: public CodeStub {
char* name_; char* name_;
const char* GetName(); virtual const char* GetName();
#ifdef DEBUG #ifdef DEBUG
void Print() { void Print() {
...@@ -415,14 +415,6 @@ class NumberToStringStub: public CodeStub { ...@@ -415,14 +415,6 @@ class NumberToStringStub: public CodeStub {
int MinorKey() { return 0; } int MinorKey() { return 0; }
void Generate(MacroAssembler* masm); void Generate(MacroAssembler* masm);
const char* GetName() { return "NumberToStringStub"; }
#ifdef DEBUG
void Print() {
PrintF("NumberToStringStub\n");
}
#endif
}; };
...@@ -466,13 +458,6 @@ class StringDictionaryLookupStub: public CodeStub { ...@@ -466,13 +458,6 @@ class StringDictionaryLookupStub: public CodeStub {
StringDictionary::kHeaderSize + StringDictionary::kHeaderSize +
StringDictionary::kElementsStartIndex * kPointerSize; StringDictionary::kElementsStartIndex * kPointerSize;
#ifdef DEBUG
void Print() {
PrintF("StringDictionaryLookupStub\n");
}
#endif
Major MajorKey() { return StringDictionaryNegativeLookup; } Major MajorKey() { return StringDictionaryNegativeLookup; }
int MinorKey() { int MinorKey() {
......
...@@ -305,12 +305,6 @@ class ConvertToDoubleStub : public CodeStub { ...@@ -305,12 +305,6 @@ class ConvertToDoubleStub : public CodeStub {
} }
void Generate(MacroAssembler* masm); void Generate(MacroAssembler* masm);
const char* GetName() { return "ConvertToDoubleStub"; }
#ifdef DEBUG
void Print() { PrintF("ConvertToDoubleStub\n"); }
#endif
}; };
......
...@@ -79,7 +79,7 @@ class UnaryOpStub: public CodeStub { ...@@ -79,7 +79,7 @@ class UnaryOpStub: public CodeStub {
char* name_; char* name_;
const char* GetName(); virtual const char* GetName();
#ifdef DEBUG #ifdef DEBUG
void Print() { void Print() {
...@@ -176,7 +176,7 @@ class BinaryOpStub: public CodeStub { ...@@ -176,7 +176,7 @@ class BinaryOpStub: public CodeStub {
char* name_; char* name_;
const char* GetName(); virtual const char* GetName();
#ifdef DEBUG #ifdef DEBUG
void Print() { void Print() {
...@@ -374,12 +374,6 @@ class WriteInt32ToHeapNumberStub : public CodeStub { ...@@ -374,12 +374,6 @@ class WriteInt32ToHeapNumberStub : public CodeStub {
} }
void Generate(MacroAssembler* masm); void Generate(MacroAssembler* masm);
const char* GetName() { return "WriteInt32ToHeapNumberStub"; }
#ifdef DEBUG
void Print() { PrintF("WriteInt32ToHeapNumberStub\n"); }
#endif
}; };
...@@ -406,14 +400,6 @@ class NumberToStringStub: public CodeStub { ...@@ -406,14 +400,6 @@ class NumberToStringStub: public CodeStub {
int MinorKey() { return 0; } int MinorKey() { return 0; }
void Generate(MacroAssembler* masm); void Generate(MacroAssembler* masm);
const char* GetName() { return "NumberToStringStub"; }
#ifdef DEBUG
void Print() {
PrintF("NumberToStringStub\n");
}
#endif
}; };
...@@ -431,8 +417,6 @@ class RegExpCEntryStub: public CodeStub { ...@@ -431,8 +417,6 @@ class RegExpCEntryStub: public CodeStub {
int MinorKey() { return 0; } int MinorKey() { return 0; }
bool NeedsImmovableCode() { return true; } bool NeedsImmovableCode() { return true; }
const char* GetName() { return "RegExpCEntryStub"; }
}; };
// Trampoline stub to call into native code. To call safely into native code // Trampoline stub to call into native code. To call safely into native code
...@@ -453,8 +437,6 @@ class DirectCEntryStub: public CodeStub { ...@@ -453,8 +437,6 @@ class DirectCEntryStub: public CodeStub {
int MinorKey() { return 0; } int MinorKey() { return 0; }
bool NeedsImmovableCode() { return true; } bool NeedsImmovableCode() { return true; }
const char* GetName() { return "DirectCEntryStub"; }
}; };
class FloatingPointHelper : public AllStatic { class FloatingPointHelper : public AllStatic {
...@@ -636,13 +618,6 @@ class StringDictionaryLookupStub: public CodeStub { ...@@ -636,13 +618,6 @@ class StringDictionaryLookupStub: public CodeStub {
StringDictionary::kHeaderSize + StringDictionary::kHeaderSize +
StringDictionary::kElementsStartIndex * kPointerSize; StringDictionary::kElementsStartIndex * kPointerSize;
#ifdef DEBUG
void Print() {
PrintF("StringDictionaryLookupStub\n");
}
#endif
Major MajorKey() { return StringDictionaryNegativeLookup; } Major MajorKey() { return StringDictionaryNegativeLookup; }
int MinorKey() { int MinorKey() {
......
...@@ -79,7 +79,7 @@ class UnaryOpStub: public CodeStub { ...@@ -79,7 +79,7 @@ class UnaryOpStub: public CodeStub {
char* name_; char* name_;
const char* GetName(); virtual const char* GetName();
#ifdef DEBUG #ifdef DEBUG
void Print() { void Print() {
...@@ -179,7 +179,7 @@ class BinaryOpStub: public CodeStub { ...@@ -179,7 +179,7 @@ class BinaryOpStub: public CodeStub {
char* name_; char* name_;
const char* GetName(); virtual const char* GetName();
#ifdef DEBUG #ifdef DEBUG
void Print() { void Print() {
...@@ -410,14 +410,6 @@ class NumberToStringStub: public CodeStub { ...@@ -410,14 +410,6 @@ class NumberToStringStub: public CodeStub {
int MinorKey() { return 0; } int MinorKey() { return 0; }
void Generate(MacroAssembler* masm); void Generate(MacroAssembler* masm);
const char* GetName() { return "NumberToStringStub"; }
#ifdef DEBUG
void Print() {
PrintF("NumberToStringStub\n");
}
#endif
}; };
...@@ -461,13 +453,6 @@ class StringDictionaryLookupStub: public CodeStub { ...@@ -461,13 +453,6 @@ class StringDictionaryLookupStub: public CodeStub {
StringDictionary::kHeaderSize + StringDictionary::kHeaderSize +
StringDictionary::kElementsStartIndex * kPointerSize; StringDictionary::kElementsStartIndex * kPointerSize;
#ifdef DEBUG
void Print() {
PrintF("StringDictionaryLookupStub\n");
}
#endif
Major MajorKey() { return StringDictionaryNegativeLookup; } Major MajorKey() { return StringDictionaryNegativeLookup; }
int MinorKey() { int MinorKey() {
......
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