Changeset 281115 in webkit


Ignore:
Timestamp:
Aug 16, 2021, 4:11:51 PM (4 years ago)
Author:
mark.lam@apple.com
Message:

Ensure that unused LLInt opcodes are not inadvertently used.
https://bugs.webkit.org/show_bug.cgi?id=229161

Reviewed by Robin Morisset.

The op macro is used for generating LLInt asm code for some entry points to the
LLInt, where we don't need 16 bits and 32 bit wide versions of the entry point.
For example, we use it for llint_program_prologue.

Note that llint_program_prologue is generated using:

op(llint_program_prologue, macro () ...

where op is:

macro op(l, fn)

commonOp(l, macro () end, macro (size)

size(fn, macro() end, macro() end, macro(gen) gen() end)
# ----- wide32 generator
# `------------------ wide16 generator

end)

end

Note that the generators for the wide16 and wide32 versions of the entry point
currently emit nothing. As a result, if we ever have a bug that ends up
dispatching to llint_program_prologue_wide16 or llint_program_prologue_wide32,
we'll end up falling thru to llint_module_program_prologue, which just happens
to be the entry point positioned after those labels.

This patch adds breakpoints in those 2 unused generators so that we won't
inadvertently execute code for something else.

  • llint/LowLevelInterpreter.asm:
Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/Source/JavaScriptCore/ChangeLog

    r281062 r281115  
     12021-08-16  Mark Lam  <mark.lam@apple.com>
     2
     3        Ensure that unused LLInt opcodes are not inadvertently used.
     4        https://bugs.webkit.org/show_bug.cgi?id=229161
     5
     6        Reviewed by Robin Morisset.
     7
     8        The op macro is used for generating LLInt asm code for some entry points to the
     9        LLInt, where we don't need 16 bits and 32 bit wide versions of the entry point.
     10        For example, we use it for llint_program_prologue.
     11
     12        Note that llint_program_prologue is generated using:
     13
     14            op(llint_program_prologue, macro () ...
     15
     16        where op is:
     17
     18            macro op(l, fn)
     19                commonOp(l, macro () end, macro (size)
     20                    size(fn, macro() end, macro() end, macro(gen) gen() end)
     21                    #        ^            ^----- wide32 generator
     22                    #        `------------------ wide16 generator
     23                end)
     24            end
     25
     26        Note that the generators for the wide16 and wide32 versions of the entry point
     27        currently emit nothing.  As a result, if we ever have a bug that ends up
     28        dispatching to llint_program_prologue_wide16 or llint_program_prologue_wide32,
     29        we'll end up falling thru to llint_module_program_prologue, which just happens
     30        to be the entry point positioned after those labels.
     31
     32        This patch adds breakpoints in those 2 unused generators so that we won't
     33        inadvertently execute code for something else.
     34
     35        * llint/LowLevelInterpreter.asm:
     36
    1372021-08-15  Yijia Huang  <yijia_huang@apple.com>
    238
  • TabularUnified trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm

    r280760 r281115  
    458458macro op(l, fn)
    459459    commonOp(l, macro () end, macro (size)
    460         size(fn, macro() end, macro() end, macro(gen) gen() end)
     460        size(fn, macro() break end, macro() break end, macro(gen) gen() end)
    461461    end)
    462462end
Note: See TracChangeset for help on using the changeset viewer.