Changeset 206147 in webkit


Ignore:
Timestamp:
Sep 20, 2016 8:45:43 AM (8 years ago)
Author:
Yusuke Suzuki
Message:

[JSC] Add typeof value === "symbol" handling to bytecode compiler
https://bugs.webkit.org/show_bug.cgi?id=162253

Reviewed by Sam Weinig.

JSTests:

  • microbenchmarks/is-symbol-mixed.js: Added.

(isSymbol):
(i.let.pair.of.list.String):

  • microbenchmarks/is-symbol.js: Added.

(isSymbol):

Source/JavaScriptCore:

Add typeof value === "symbol" handling to the bytecode compiler.
The effect is tiny, but it keeps consistency since the bytecode compiler
already has the similar optimization for "string" case.

  • bytecode/SpeculatedType.cpp:

(JSC::speculationFromJSType):

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::emitEqualityOp):

Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r206136 r206147  
     12016-09-20  Yusuke Suzuki  <utatane.tea@gmail.com>
     2
     3        [JSC] Add `typeof value === "symbol"` handling to bytecode compiler
     4        https://bugs.webkit.org/show_bug.cgi?id=162253
     5
     6        Reviewed by Sam Weinig.
     7
     8        * microbenchmarks/is-symbol-mixed.js: Added.
     9        (isSymbol):
     10        (i.let.pair.of.list.String):
     11        * microbenchmarks/is-symbol.js: Added.
     12        (isSymbol):
     13
    1142016-09-19  Saam Barati  <sbarati@apple.com>
    215
  • trunk/Source/JavaScriptCore/ChangeLog

    r206136 r206147  
     12016-09-20  Yusuke Suzuki  <utatane.tea@gmail.com>
     2
     3        [JSC] Add `typeof value === "symbol"` handling to bytecode compiler
     4        https://bugs.webkit.org/show_bug.cgi?id=162253
     5
     6        Reviewed by Sam Weinig.
     7
     8        Add `typeof value === "symbol"` handling to the bytecode compiler.
     9        The effect is tiny, but it keeps consistency since the bytecode compiler
     10        already has the similar optimization for "string" case.
     11
     12        * bytecode/SpeculatedType.cpp:
     13        (JSC::speculationFromJSType):
     14        * bytecompiler/BytecodeGenerator.cpp:
     15        (JSC::BytecodeGenerator::emitEqualityOp):
     16
    1172016-09-19  Saam Barati  <sbarati@apple.com>
    218
  • trunk/Source/JavaScriptCore/bytecode/SpeculatedType.cpp

    r206104 r206147  
    477477    case StringType:
    478478        return SpecString;
     479    case SymbolType:
     480        return SpecSymbol;
    479481    case ArrayType:
    480482        return SpecArray;
  • trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp

    r206098 r206147  
    16641664                instructions().append(srcIndex);
    16651665                instructions().append(StringType);
     1666                return dst;
     1667            }
     1668            if (value == "symbol") {
     1669                rewindUnaryOp();
     1670                emitOpcode(op_is_cell_with_type);
     1671                instructions().append(dst->index());
     1672                instructions().append(srcIndex);
     1673                instructions().append(SymbolType);
    16661674                return dst;
    16671675            }
Note: See TracChangeset for help on using the changeset viewer.