Changeset 229912 in webkit
- Timestamp:
- Mar 23, 2018 11:55:26 AM (6 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r229911 r229912 1 2018-03-23 Mark Lam <mark.lam@apple.com> 2 3 LLInt TypeArray pointer poisoning should not pick its poison dynamically. 4 https://bugs.webkit.org/show_bug.cgi?id=183942 5 <rdar://problem/38798018> 6 7 Reviewed by JF Bastien. 8 9 1. Move the LLInt TypedArray unpoisoning to just before the array access after 10 all the branches. 11 2. Renamed FirstArrayType to FirstTypedArrayType to match the symbol in C++ code. 12 3. Remove a useless instruction in the implementation of emitX86Lea for a global 13 label. 14 15 * llint/LowLevelInterpreter.asm: 16 * llint/LowLevelInterpreter64.asm: 17 * offlineasm/x86.rb: 18 1 19 2018-03-23 Mark Lam <mark.lam@apple.com> 2 20 -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
r229852 r229912 401 401 const Float64ArrayType = constexpr Float64ArrayType 402 402 403 const First ArrayType = constexpr FirstTypedArrayType403 const FirstTypedArrayType = constexpr FirstTypedArrayType 404 404 const NumberOfTypedArrayTypesExcludingDataView = constexpr NumberOfTypedArrayTypesExcludingDataView 405 405 const TypedArrayPoisonIndexMask = constexpr TypedArrayPoisonIndexMask -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
r229547 r229912 403 403 macro loadTypedArrayCaged(basePtr, mask, source, typeIndex, dest, scratch) 404 404 if POISON 405 andp TypedArrayPoisonIndexMask, typeIndex406 405 leap _g_typedArrayPoisons, dest 407 loadp [dest, typeIndex, 8], dest406 loadp (typeIndex - FirstTypedArrayType) * 8[dest], dest 408 407 loadp source, scratch 409 408 xorp scratch, dest … … 1577 1576 # First lets check if we even have a typed array. This lets us do some boilerplate up front. 1578 1577 loadb JSCell::m_type[t0], t2 1579 subi First ArrayType, t21578 subi FirstTypedArrayType, t2 1580 1579 biaeq t2, NumberOfTypedArrayTypesExcludingDataView, .opGetByValSlow 1581 1580 1582 1581 # Sweet, now we know that we have a typed array. Do some basic things now. 1583 1582 biaeq t1, JSArrayBufferView::m_length[t0], .opGetByValSlow 1584 loadTypedArrayCaged(_g_gigacageBasePtrs + Gigacage::BasePtrs::primitive, constexpr PRIMITIVE_GIGACAGE_MASK, JSArrayBufferView::m_poisonedVector[t0], t2, t3, t5)1585 1583 1586 1584 # Now bisect through the various types: … … 1595 1593 # Float64ArrayType, 1596 1594 1597 bia t2, Uint16ArrayType - First ArrayType, .opGetByValAboveUint16Array1595 bia t2, Uint16ArrayType - FirstTypedArrayType, .opGetByValAboveUint16Array 1598 1596 1599 1597 # We have one of Int8ArrayType .. Uint16ArrayType. 1600 bia t2, Uint8ClampedArrayType - First ArrayType, .opGetByValInt16ArrayOrUint16Array1598 bia t2, Uint8ClampedArrayType - FirstTypedArrayType, .opGetByValInt16ArrayOrUint16Array 1601 1599 1602 1600 # We have one of Int8ArrayType ... Uint8ClampedArrayType 1603 bineq t2, Int8ArrayType - FirstArrayType, .opGetByValUint8ArrayOrUint8ClampedArray 1604 1605 # We have Int8ArrayType 1601 bia t2, Int8ArrayType - FirstTypedArrayType, .opGetByValUint8ArrayOrUint8ClampedArray 1602 1603 # We have Int8ArrayType. 1604 loadTypedArrayCaged(_g_gigacageBasePtrs + Gigacage::BasePtrs::primitive, constexpr PRIMITIVE_GIGACAGE_MASK, JSArrayBufferView::m_poisonedVector[t0], Int8ArrayType, t3, t2) 1606 1605 loadbs [t3, t1], t0 1607 1606 finishIntGetByVal(t0, t1) 1608 1607 1609 1608 .opGetByValUint8ArrayOrUint8ClampedArray: 1610 # We have either Uint8ArrayType or Uint8ClampedArrayType. They behave the same so that's cool. 1609 bia t2, Uint8ArrayType - FirstTypedArrayType, .opGetByValUint8ClampedArray 1610 1611 # We have Uint8ArrayType. 1612 loadTypedArrayCaged(_g_gigacageBasePtrs + Gigacage::BasePtrs::primitive, constexpr PRIMITIVE_GIGACAGE_MASK, JSArrayBufferView::m_poisonedVector[t0], Uint8ArrayType, t3, t2) 1611 1613 loadb [t3, t1], t0 1612 1614 finishIntGetByVal(t0, t1) 1613 1615 1616 .opGetByValUint8ClampedArray: 1617 # We have Uint8ClampedArrayType. 1618 loadTypedArrayCaged(_g_gigacageBasePtrs + Gigacage::BasePtrs::primitive, constexpr PRIMITIVE_GIGACAGE_MASK, JSArrayBufferView::m_poisonedVector[t0], Uint8ClampedArrayType, t3, t2) 1619 loadb [t3, t1], t0 1620 finishIntGetByVal(t0, t1) 1621 1614 1622 .opGetByValInt16ArrayOrUint16Array: 1615 1623 # We have either Int16ArrayType or Uint16ClampedArrayType. 1616 bi eq t2, Uint16ArrayType - FirstArrayType, .opGetByValUint16Array1624 bia t2, Int16ArrayType - FirstTypedArrayType, .opGetByValUint16Array 1617 1625 1618 1626 # We have Int16ArrayType. 1627 loadTypedArrayCaged(_g_gigacageBasePtrs + Gigacage::BasePtrs::primitive, constexpr PRIMITIVE_GIGACAGE_MASK, JSArrayBufferView::m_poisonedVector[t0], Int16ArrayType, t3, t2) 1619 1628 loadhs [t3, t1, 2], t0 1620 1629 finishIntGetByVal(t0, t1) … … 1622 1631 .opGetByValUint16Array: 1623 1632 # We have Uint16ArrayType. 1633 loadTypedArrayCaged(_g_gigacageBasePtrs + Gigacage::BasePtrs::primitive, constexpr PRIMITIVE_GIGACAGE_MASK, JSArrayBufferView::m_poisonedVector[t0], Uint16ArrayType, t3, t2) 1624 1634 loadh [t3, t1, 2], t0 1625 1635 finishIntGetByVal(t0, t1) … … 1627 1637 .opGetByValAboveUint16Array: 1628 1638 # We have one of Int32ArrayType .. Float64ArrayType. 1629 bia t2, Uint32ArrayType - First ArrayType, .opGetByValFloat32ArrayOrFloat64Array1639 bia t2, Uint32ArrayType - FirstTypedArrayType, .opGetByValFloat32ArrayOrFloat64Array 1630 1640 1631 1641 # We have either Int32ArrayType or Uint32ArrayType 1632 bineq t2, Int32ArrayType - FirstArrayType, .opGetByValUint32Array 1633 1634 # We have Int32ArrayType 1642 bia t2, Int32ArrayType - FirstTypedArrayType, .opGetByValUint32Array 1643 1644 # We have Int32ArrayType. 1645 loadTypedArrayCaged(_g_gigacageBasePtrs + Gigacage::BasePtrs::primitive, constexpr PRIMITIVE_GIGACAGE_MASK, JSArrayBufferView::m_poisonedVector[t0], Int32ArrayType, t3, t2) 1635 1646 loadi [t3, t1, 4], t0 1636 1647 finishIntGetByVal(t0, t1) … … 1638 1649 .opGetByValUint32Array: 1639 1650 # We have Uint32ArrayType. 1651 loadTypedArrayCaged(_g_gigacageBasePtrs + Gigacage::BasePtrs::primitive, constexpr PRIMITIVE_GIGACAGE_MASK, JSArrayBufferView::m_poisonedVector[t0], Uint32ArrayType, t3, t2) 1640 1652 # This is the hardest part because of large unsigned values. 1641 1653 loadi [t3, t1, 4], t0 … … 1646 1658 # We have one of Float32ArrayType or Float64ArrayType. Sadly, we cannot handle Float32Array 1647 1659 # inline yet. That would require some offlineasm changes. 1648 bieq t2, Float32ArrayType - First ArrayType, .opGetByValSlow1660 bieq t2, Float32ArrayType - FirstTypedArrayType, .opGetByValSlow 1649 1661 1650 1662 # We have Float64ArrayType. 1663 loadTypedArrayCaged(_g_gigacageBasePtrs + Gigacage::BasePtrs::primitive, constexpr PRIMITIVE_GIGACAGE_MASK, JSArrayBufferView::m_poisonedVector[t0], Float64ArrayType, t3, t2) 1651 1664 loadd [t3, t1, 8], ft0 1652 1665 bdnequn ft0, ft0, .opGetByValSlow -
trunk/Source/JavaScriptCore/offlineasm/x86.rb
r228402 r229912 591 591 if src.is_a? LabelReference 592 592 $asm.puts "movq #{src.asmLabel}@GOTPCREL(%rip), #{dst.x86Operand(:ptr)}" 593 $asm.puts "mov#{x86Suffix(kind)} #{orderOperands(dst.x86Operand(kind), dst.x86Operand(kind))}"594 593 else 595 594 $asm.puts "lea#{x86Suffix(kind)} #{orderOperands(src.x86AddressOperand(kind), dst.x86Operand(kind))}"
Note: See TracChangeset
for help on using the changeset viewer.