Reduce the number of virtual function in hydrogen-instruction.h classes

Instead of using virtual type-tester functions we can just
generate non-virtual ones for all concrete IR classes.

This is changes reduces the V8 binary size by ~2%.

I also simplified the macros to declare new hydrogen instructions slightly.
The name used for debug output is no longer passed as a separate string.
Instead we just use the class name.
Review URL: http://codereview.chromium.org/6880014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7659 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent b06ce8dd
......@@ -317,6 +317,17 @@ intptr_t HValue::Hashcode() {
}
const char* HValue::Mnemonic() const {
switch (opcode()) {
#define MAKE_CASE(type) case k##type: return #type;
HYDROGEN_CONCRETE_INSTRUCTION_LIST(MAKE_CASE)
#undef MAKE_CASE
case kPhi: return "Phi";
default: return "";
}
}
void HValue::SetOperandAt(int index, HValue* value) {
ASSERT(value == NULL || !value->representation().IsNone());
RegisterUse(index, value);
......
This diff is collapsed.
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