Changeset 30177 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Feb 12, 2008, 1:29:51 PM (17 years ago)
Author:
[email protected]
Message:

Reviewed by Brady Eidson.

<rdar://problem/5659216> REGRESSION: PLT 0.3% slower due to r28868 (caching ClassNodeList and NamedNodeList)

  • Tweak the statements in isASCIISpace to account for the statistical distribution of usage in the PLT.

.4% speedup on my machine. Stephanie's machine shows this as .3% speedup.

  • wtf/ASCIICType.h: (WTF::isASCIISpace):
Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r30158 r30177  
     12008-02-08  Samuel Weinig  <[email protected]>
     2
     3        Reviewed by Brady Eidson.
     4
     5        <rdar://problem/5659216> REGRESSION: PLT 0.3% slower due to r28868 (caching ClassNodeList and NamedNodeList)
     6
     7        - Tweak the statements in isASCIISpace to account for the statistical distribution of
     8          usage in the PLT.
     9
     10        .4% speedup on my machine.  Stephanie's machine shows this as .3% speedup.
     11
     12        * wtf/ASCIICType.h:
     13        (WTF::isASCIISpace):
     14
    1152008-02-11  Sam Weinig  <[email protected]>
    216
  • trunk/JavaScriptCore/wtf/ASCIICType.h

    r29096 r30177  
    11/*
    2  * Copyright (C) 2007 Apple Inc. All rights reserved.
     2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    8686    inline bool isASCIIUpper(int c) { return c >= 'A' && c <= 'Z'; }
    8787
    88     inline bool isASCIISpace(char c) { return c == '\t' || c == '\n' || c == '\v' || c =='\f' || c == '\r' || c == ' '; }
    89     inline bool isASCIISpace(unsigned short c) { return c == '\t' || c == '\n' || c == '\v' || c =='\f' || c == '\r' || c == ' '; }
     88    /*
     89        Statistics from a run of the PLT on the usage of isASCIISpace:
     90        Hex  Name               Count
     91        ---  ----               -----
     92           ALL OTHER VALUES     689383
     93        x20  SPACE              294720
     94        x0A  NEWLINE            89059
     95        x09  TAB                28320
     96        x0D  CARRIAGE RETURN    0
     97        x0C  FORMFEED           0
     98        x0B  VERTICAL TAB       0
     99
     100    */
     101
     102    inline bool isASCIISpace(char c) { return c <= ' ' && (c == ' ' || (c <= 0xD && c >= 0x9)); }
     103    inline bool isASCIISpace(unsigned short c) { return c <= ' ' && (c == ' ' || (c <= 0xD && c >= 0x9)); }
    90104#if !COMPILER(MSVC) || defined(_NATIVE_WCHAR_T_DEFINED)
    91     inline bool isASCIISpace(wchar_t c) { return c == '\t' || c == '\n' || c == '\v' || c =='\f' || c == '\r' || c == ' '; }
     105    inline bool isASCIISpace(wchar_t c) { return c <= ' ' && (c == ' ' || (c <= 0xD && c >= 0x9)); }
    92106#endif
    93     inline bool isASCIISpace(int c) { return c == '\t' || c == '\n' || c == '\v' || c =='\f' || c == '\r' || c == ' '; }
     107    inline bool isASCIISpace(int c) { return c <= ' ' && (c == ' ' || (c <= 0xD && c >= 0x9)); }
    94108
    95109    inline char toASCIILower(char c) { return c | ((c >= 'A' && c <= 'Z') << 5); }
Note: See TracChangeset for help on using the changeset viewer.