Ignore:
Timestamp:
Sep 14, 2008, 5:26:08 PM (17 years ago)
Author:
[email protected]
Message:

2008-09-14 Cameron Zwarich <[email protected]>

Reviewed by Maciej Stachowiak.

Bug 20827: the 'typeof' operator is slow
<https://bugs.webkit.org/show_bug.cgi?id=20827>

Optimize the 'typeof' operator when its result is compared to a constant
string.

This is a 5.5% speedup on the V8 Earley-Boyer test.

JavaScriptCore:

  • VM/CTI.cpp: (JSC::CTI::privateCompileMainPass):
  • VM/CodeBlock.cpp: (JSC::CodeBlock::dump):
  • VM/CodeGenerator.cpp: (JSC::CodeGenerator::emitEqualityOp):
  • VM/CodeGenerator.h:
  • VM/Machine.cpp: (JSC::jsIsObjectType): (JSC::jsIsFunctionType): (JSC::Machine::privateExecute): (JSC::Machine::cti_op_is_undefined): (JSC::Machine::cti_op_is_boolean): (JSC::Machine::cti_op_is_number): (JSC::Machine::cti_op_is_string): (JSC::Machine::cti_op_is_object): (JSC::Machine::cti_op_is_function):
  • VM/Machine.h:
  • VM/Opcode.h:
  • kjs/nodes.cpp: (JSC::BinaryOpNode::emitCode): (JSC::EqualNode::emitCode): (JSC::StrictEqualNode::emitCode):
  • kjs/nodes.h:

LayoutTests:

  • fast/js/resources/typeof-codegen-crash.js: Added.
  • fast/js/typeof-codegen-crash-expected.txt: Added.
  • fast/js/typeof-codegen-crash.html: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/VM/CodeBlock.cpp

    r36408 r36412  
    496496            break;
    497497        }
     498        case op_is_undefined: {
     499            printUnaryOp(location, it, "is_undefined");
     500            break;
     501        }
     502        case op_is_boolean: {
     503            printUnaryOp(location, it, "is_boolean");
     504            break;
     505        }
     506        case op_is_number: {
     507            printUnaryOp(location, it, "is_number");
     508            break;
     509        }
     510        case op_is_string: {
     511            printUnaryOp(location, it, "is_string");
     512            break;
     513        }
     514        case op_is_object: {
     515            printUnaryOp(location, it, "is_object");
     516            break;
     517        }
     518        case op_is_function: {
     519            printUnaryOp(location, it, "is_function");
     520            break;
     521        }
    498522        case op_in: {
    499523            printBinaryOp(location, it, "in");
Note: See TracChangeset for help on using the changeset viewer.