Changeset 27615 in webkit for trunk/JavaScriptCore/kjs/nodes.cpp


Ignore:
Timestamp:
Nov 8, 2007, 2:23:39 PM (18 years ago)
Author:
oliver
Message:

Add a fast path for bitwise-and of two immediate numbers for a 0.7% improvement in SunSpider (4% bitop improvement).

Reviewed by Sam.

This only improves bitwise-and performance, as the additional logic required
for similar code paths on or, xor, and shifting requires additional operations
and branches that negate (and in certain cases, regress) any advantage we might
otherwise receive.

This improves performance on all bitop tests, the cryptography tests, as well as
the string-base64 and string-unpack-code tests. No significant degradation on
any other tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/nodes.cpp

    r27589 r27615  
    21862186// ECMA 11.10
    21872187JSValue *BitAndNode::evaluate(ExecState *exec)
    2188 {
     2188{   
    21892189  JSValue *v1 = expr1->evaluate(exec);
    21902190  KJS_CHECKEXCEPTIONVALUE
     
    21922192  KJS_CHECKEXCEPTIONVALUE
    21932193 
    2194   return jsNumber(v1->toInt32(exec) & v2->toInt32(exec));
     2194  return jsNumberFromAnd(exec, v1, v2);
    21952195}
    21962196
Note: See TracChangeset for help on using the changeset viewer.