Ignore:
Timestamp:
Jan 13, 2015, 12:17:54 PM (11 years ago)
Author:
Yusuke Suzuki
Message:

DFG can call PutByValDirect for generic arrays
https://bugs.webkit.org/show_bug.cgi?id=140389

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Computed properties in object initializers (ES6) use the put_by_val_direct operation.
However, current DFG asserts that put_by_val_direct is not used for the generic array,
the assertion failure is raised.
This patch allow DFG to use put_by_val_direct to generic arrays.

And fix the DFG put_by_val_direct implementation for string properties.
At first, put_by_val_direct is inteded to be used for spread elements.
So the property keys were limited to numbers (indexes).
But now, it's also used for computed properties in object initializers.

  • dfg/DFGOperations.cpp:

(JSC::DFG::operationPutByValInternal):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

LayoutTests:

  • js/dfg-put-by-val-direct-to-generic-array-expected.txt: Added.
  • js/dfg-put-by-val-direct-to-generic-array.html: Added.
  • js/script-tests/dfg-put-by-val-direct-to-generic-array.js: Added.

(foo1):
(foo2):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r178365 r178370  
     12015-01-13  Yusuke Suzuki  <[email protected]>
     2
     3        DFG can call PutByValDirect for generic arrays
     4        https://bugs.webkit.org/show_bug.cgi?id=140389
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Computed properties in object initializers (ES6) use the put_by_val_direct operation.
     9        However, current DFG asserts that put_by_val_direct is not used for the generic array,
     10        the assertion failure is raised.
     11        This patch allow DFG to use put_by_val_direct to generic arrays.
     12
     13        And fix the DFG put_by_val_direct implementation for string properties.
     14        At first, put_by_val_direct is inteded to be used for spread elements.
     15        So the property keys were limited to numbers (indexes).
     16        But now, it's also used for computed properties in object initializers.
     17
     18        * dfg/DFGOperations.cpp:
     19        (JSC::DFG::operationPutByValInternal):
     20        * dfg/DFGSpeculativeJIT64.cpp:
     21        (JSC::DFG::SpeculativeJIT::compile):
     22
    1232015-01-13  Geoffrey Garen  <[email protected]>
    224
Note: See TracChangeset for help on using the changeset viewer.