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 {
}
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 {
char* name_;
const char* GetName();
virtual const char* GetName();
#ifdef DEBUG
void Print() {
......@@ -175,7 +175,7 @@ class BinaryOpStub: public CodeStub {
char* name_;
const char* GetName();
virtual const char* GetName();
#ifdef DEBUG
void Print() {
......@@ -370,12 +370,6 @@ class WriteInt32ToHeapNumberStub : public CodeStub {
}
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 {
int MinorKey() { return 0; }
void Generate(MacroAssembler* masm);
const char* GetName() { return "NumberToStringStub"; }
};
......@@ -421,8 +413,6 @@ class RegExpCEntryStub: public CodeStub {
int MinorKey() { return 0; }
bool NeedsImmovableCode() { return true; }
const char* GetName() { return "RegExpCEntryStub"; }
};
......@@ -443,8 +433,6 @@ class DirectCEntryStub: public CodeStub {
int MinorKey() { return 0; }
bool NeedsImmovableCode() { return true; }
const char* GetName() { return "DirectCEntryStub"; }
};
......@@ -627,13 +615,6 @@ class StringDictionaryLookupStub: public CodeStub {
StringDictionary::kHeaderSize +
StringDictionary::kElementsStartIndex * kPointerSize;
#ifdef DEBUG
void Print() {
PrintF("StringDictionaryLookupStub\n");
}
#endif
Major MajorKey() { return StringDictionaryNegativeLookup; }
int MinorKey() {
......
......@@ -170,7 +170,7 @@ MaybeObject* CodeStub::TryGetCode() {
const char* CodeStub::MajorName(CodeStub::Major major_key,
bool allow_unknown_keys) {
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)
#undef DEF_CASE
default:
......
......@@ -189,7 +189,7 @@ class CodeStub BASE_EMBEDDED {
// a fixed (non-moveable) code object.
virtual bool NeedsImmovableCode() { return false; }
#ifdef DEBUG
#ifdef DEBUG
virtual void Print() { PrintF("%s\n", GetName()); }
#endif
......@@ -274,8 +274,6 @@ class StackCheckStub : public CodeStub {
void Generate(MacroAssembler* masm);
private:
const char* GetName() { return "StackCheckStub"; }
Major MajorKey() { return StackCheck; }
int MinorKey() { return 0; }
};
......@@ -290,7 +288,6 @@ class ToNumberStub: public CodeStub {
private:
Major MajorKey() { return ToNumber; }
int MinorKey() { return 0; }
const char* GetName() { return "ToNumberStub"; }
};
......@@ -302,7 +299,6 @@ class FastNewClosureStub : public CodeStub {
void Generate(MacroAssembler* masm);
private:
const char* GetName() { return "FastNewClosureStub"; }
Major MajorKey() { return FastNewClosure; }
int MinorKey() { return strict_mode_; }
......@@ -323,7 +319,6 @@ class FastNewContextStub : public CodeStub {
private:
int slots_;
const char* GetName() { return "FastNewContextStub"; }
Major MajorKey() { return FastNewContext; }
int MinorKey() { return slots_; }
};
......@@ -352,7 +347,6 @@ class FastCloneShallowArrayStub : public CodeStub {
Mode mode_;
int length_;
const char* GetName() { return "FastCloneShallowArrayStub"; }
Major MajorKey() { return FastCloneShallowArray; }
int MinorKey() {
ASSERT(mode_ == 0 || mode_ == 1);
......@@ -393,7 +387,7 @@ class InstanceofStub: public CodeStub {
return (flags_ & kReturnTrueFalseObject) != 0;
}
const char* GetName();
virtual const char* GetName();
Flags flags_;
char* name_;
......@@ -408,8 +402,6 @@ class MathPowStub: public CodeStub {
private:
virtual CodeStub::Major MajorKey() { return MathPow; }
virtual int MinorKey() { return 0; }
const char* GetName() { return "MathPowStub"; }
};
......@@ -544,7 +536,7 @@ class CompareStub: public CodeStub {
// 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.
char* name_;
const char* GetName();
virtual const char* GetName();
#ifdef DEBUG
void Print() {
PrintF("CompareStub (minor %d) (cc %d), (strict %s), "
......@@ -593,8 +585,6 @@ class CEntryStub : public CodeStub {
int MinorKey();
bool NeedsImmovableCode();
const char* GetName() { return "CEntryStub"; }
};
......@@ -610,8 +600,6 @@ class JSEntryStub : public CodeStub {
private:
Major MajorKey() { return JSEntry; }
int MinorKey() { return 0; }
const char* GetName() { return "JSEntryStub"; }
};
......@@ -624,7 +612,7 @@ class JSConstructEntryStub : public JSEntryStub {
private:
int MinorKey() { return 1; }
const char* GetName() { return "JSConstructEntryStub"; }
virtual const char* GetName() { return "JSConstructEntryStub"; }
};
......@@ -651,8 +639,6 @@ class ArgumentsAccessStub: public CodeStub {
void GenerateNewNonStrictFast(MacroAssembler* masm);
void GenerateNewNonStrictSlow(MacroAssembler* masm);
const char* GetName() { return "ArgumentsAccessStub"; }
#ifdef DEBUG
void Print() {
PrintF("ArgumentsAccessStub (type %d)\n", type_);
......@@ -670,14 +656,6 @@ class RegExpExecStub: public CodeStub {
int MinorKey() { return 0; }
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 {
int MinorKey() { return 0; }
void Generate(MacroAssembler* masm);
const char* GetName() { return "RegExpConstructResultStub"; }
#ifdef DEBUG
void Print() {
PrintF("RegExpConstructResultStub\n");
}
#endif
};
......@@ -921,12 +891,6 @@ class 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 {
public:
......@@ -937,10 +901,6 @@ class KeyedLoadFastElementStub : public CodeStub {
int MinorKey() { return 0; }
void Generate(MacroAssembler* masm);
const char* GetName() { return "KeyedLoadFastElementStub"; }
DECLARE_ARRAY_STUB_PRINT(KeyedLoadFastElementStub)
};
......@@ -954,10 +914,6 @@ class KeyedStoreFastElementStub : public CodeStub {
void Generate(MacroAssembler* masm);
const char* GetName() { return "KeyedStoreFastElementStub"; }
DECLARE_ARRAY_STUB_PRINT(KeyedStoreFastElementStub)
private:
bool is_js_array_;
};
......@@ -973,10 +929,6 @@ class KeyedLoadExternalArrayStub : public CodeStub {
void Generate(MacroAssembler* masm);
const char* GetName() { return "KeyedLoadExternalArrayStub"; }
DECLARE_ARRAY_STUB_PRINT(KeyedLoadExternalArrayStub)
protected:
JSObject::ElementsKind elements_kind_;
};
......@@ -992,10 +944,6 @@ class KeyedStoreExternalArrayStub : public CodeStub {
void Generate(MacroAssembler* masm);
const char* GetName() { return "KeyedStoreExternalArrayStub"; }
DECLARE_ARRAY_STUB_PRINT(KeyedStoreExternalArrayStub)
protected:
JSObject::ElementsKind elements_kind_;
};
......
......@@ -80,7 +80,7 @@ class UnaryOpStub: public CodeStub {
char* name_;
const char* GetName();
virtual const char* GetName();
#ifdef DEBUG
void Print() {
......@@ -186,7 +186,7 @@ class BinaryOpStub: public CodeStub {
char* name_;
const char* GetName();
virtual const char* GetName();
#ifdef DEBUG
void Print() {
......@@ -415,14 +415,6 @@ class NumberToStringStub: public CodeStub {
int MinorKey() { return 0; }
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 {
StringDictionary::kHeaderSize +
StringDictionary::kElementsStartIndex * kPointerSize;
#ifdef DEBUG
void Print() {
PrintF("StringDictionaryLookupStub\n");
}
#endif
Major MajorKey() { return StringDictionaryNegativeLookup; }
int MinorKey() {
......
......@@ -305,12 +305,6 @@ class ConvertToDoubleStub : public CodeStub {
}
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 {
char* name_;
const char* GetName();
virtual const char* GetName();
#ifdef DEBUG
void Print() {
......@@ -176,7 +176,7 @@ class BinaryOpStub: public CodeStub {
char* name_;
const char* GetName();
virtual const char* GetName();
#ifdef DEBUG
void Print() {
......@@ -374,12 +374,6 @@ class WriteInt32ToHeapNumberStub : public CodeStub {
}
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 {
int MinorKey() { return 0; }
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 {
int MinorKey() { return 0; }
bool NeedsImmovableCode() { return true; }
const char* GetName() { return "RegExpCEntryStub"; }
};
// Trampoline stub to call into native code. To call safely into native code
......@@ -453,8 +437,6 @@ class DirectCEntryStub: public CodeStub {
int MinorKey() { return 0; }
bool NeedsImmovableCode() { return true; }
const char* GetName() { return "DirectCEntryStub"; }
};
class FloatingPointHelper : public AllStatic {
......@@ -636,13 +618,6 @@ class StringDictionaryLookupStub: public CodeStub {
StringDictionary::kHeaderSize +
StringDictionary::kElementsStartIndex * kPointerSize;
#ifdef DEBUG
void Print() {
PrintF("StringDictionaryLookupStub\n");
}
#endif
Major MajorKey() { return StringDictionaryNegativeLookup; }
int MinorKey() {
......
......@@ -79,7 +79,7 @@ class UnaryOpStub: public CodeStub {
char* name_;
const char* GetName();
virtual const char* GetName();
#ifdef DEBUG
void Print() {
......@@ -179,7 +179,7 @@ class BinaryOpStub: public CodeStub {
char* name_;
const char* GetName();
virtual const char* GetName();
#ifdef DEBUG
void Print() {
......@@ -410,14 +410,6 @@ class NumberToStringStub: public CodeStub {
int MinorKey() { return 0; }
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 {
StringDictionary::kHeaderSize +
StringDictionary::kElementsStartIndex * kPointerSize;
#ifdef DEBUG
void Print() {
PrintF("StringDictionaryLookupStub\n");
}
#endif
Major MajorKey() { return StringDictionaryNegativeLookup; }
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