Changeset 238778 in webkit


Ignore:
Timestamp:
Dec 1, 2018, 12:38:53 AM (7 years ago)
Author:
yusukesuzuki@slowstart.org
Message:

[JSC] Keep TypeMaybeBigInt small
https://bugs.webkit.org/show_bug.cgi?id=192203

Reviewed by Saam Barati.

As BigInt is being implemented, more and more bytecodes start returning BigInt.
It means that ResultType of these bytecodes include TypeMaybeBigInt. However,
TypeMaybeBigInt was large number 0x20, leading to wide instruction since ResultType
easily becomes larger than 32 (e.g. TypeInt32 | TypeMaybeBigInt == 33).

This patch sorts the numbers of TypeMaybeXXX based on the frequency of appearance in
the code.

  • parser/ResultType.h:
Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r238766 r238778  
     12018-11-29  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
     2
     3        [JSC] Keep TypeMaybeBigInt small
     4        https://bugs.webkit.org/show_bug.cgi?id=192203
     5
     6        Reviewed by Saam Barati.
     7
     8        As BigInt is being implemented, more and more bytecodes start returning BigInt.
     9        It means that ResultType of these bytecodes include TypeMaybeBigInt. However,
     10        TypeMaybeBigInt was large number 0x20, leading to wide instruction since ResultType
     11        easily becomes larger than 32 (e.g. TypeInt32 | TypeMaybeBigInt == 33).
     12
     13        This patch sorts the numbers of TypeMaybeXXX based on the frequency of appearance in
     14        the code.
     15
     16        * parser/ResultType.h:
     17
    1182018-11-30  Dean Jackson  <dino@apple.com>
    219
  • trunk/Source/JavaScriptCore/parser/ResultType.h

    r238543 r238778  
    3333
    3434        using Type = uint8_t;
    35         static constexpr Type TypeInt32 = 1;
    36         static constexpr Type TypeMaybeNumber = 0x02;
    37         static constexpr Type TypeMaybeString = 0x04;
    38         static constexpr Type TypeMaybeNull   = 0x08;
    39         static constexpr Type TypeMaybeBool   = 0x10;
    40         static constexpr Type TypeMaybeBigInt = 0x20;
    41         static constexpr Type TypeMaybeOther  = 0x40;
    42 
    43         static constexpr Type TypeBits = TypeMaybeNumber | TypeMaybeString | TypeMaybeNull | TypeMaybeBool | TypeMaybeBigInt | TypeMaybeOther;
     35        static constexpr Type TypeInt32       = 0x1 << 0;
     36        static constexpr Type TypeMaybeNumber = 0x1 << 1;
     37        static constexpr Type TypeMaybeString = 0x1 << 2;
     38        static constexpr Type TypeMaybeBigInt = 0x1 << 3;
     39        static constexpr Type TypeMaybeNull   = 0x1 << 4;
     40        static constexpr Type TypeMaybeBool   = 0x1 << 5;
     41        static constexpr Type TypeMaybeOther  = 0x1 << 6;
     42
     43        static constexpr Type TypeBits = TypeMaybeNumber | TypeMaybeString | TypeMaybeBigInt | TypeMaybeNull | TypeMaybeBool | TypeMaybeOther;
    4444
    4545    public:
Note: See TracChangeset for help on using the changeset viewer.