Changeset 146831 in webkit


Ignore:
Timestamp:
Mar 25, 2013 5:36:18 PM (11 years ago)
Author:
mark.lam@apple.com
Message:

Offlineasm cloop backend compiles op+branch incorrectly.
https://bugs.webkit.org/show_bug.cgi?id=113146.

Reviewed by Geoffrey Garen.

  • dfg/DFGRepatch.h:

(JSC::DFG::dfgResetGetByID):
(JSC::DFG::dfgResetPutByID):

  • These functions never return when the DFG is dsiabled, not just when asserts are enabled. Changing the attribute from NO_RETURN_DUE_TO_ASSERT to NO_RETURN.
  • llint/LLIntOfflineAsmConfig.h:
  • Added some #defines needed to get the cloop building again.
  • offlineasm/cloop.rb:
  • Fix cloopEmitOpAndBranchIfOverflow() and cloopEmitOpAndBranch() to emit code that unconditionally executes the specified operation before doing the conditional branch.
Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r146829 r146831  
     12013-03-25  Mark Lam  <mark.lam@apple.com>
     2
     3        Offlineasm cloop backend compiles op+branch incorrectly.
     4        https://bugs.webkit.org/show_bug.cgi?id=113146.
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        * dfg/DFGRepatch.h:
     9        (JSC::DFG::dfgResetGetByID):
     10        (JSC::DFG::dfgResetPutByID):
     11        - These functions never return when the DFG is dsiabled, not just when
     12          asserts are enabled. Changing the attribute from NO_RETURN_DUE_TO_ASSERT
     13          to NO_RETURN.
     14        * llint/LLIntOfflineAsmConfig.h:
     15        - Added some #defines needed to get the cloop building again.
     16        * offlineasm/cloop.rb:
     17        - Fix cloopEmitOpAndBranchIfOverflow() and cloopEmitOpAndBranch() to
     18          emit code that unconditionally executes the specified operation before
     19          doing the conditional branch.
     20
    1212013-03-25  Mark Hahnenberg  <mhahnenberg@apple.com>
    222
  • trunk/Source/JavaScriptCore/dfg/DFGRepatch.h

    r140594 r146831  
    6060namespace DFG {
    6161
    62 inline NO_RETURN_DUE_TO_ASSERT void dfgResetGetByID(RepatchBuffer&, StructureStubInfo&) { RELEASE_ASSERT_NOT_REACHED(); }
    63 inline NO_RETURN_DUE_TO_ASSERT void dfgResetPutByID(RepatchBuffer&, StructureStubInfo&) { RELEASE_ASSERT_NOT_REACHED(); }
     62inline NO_RETURN void dfgResetGetByID(RepatchBuffer&, StructureStubInfo&) { RELEASE_ASSERT_NOT_REACHED(); }
     63inline NO_RETURN void dfgResetPutByID(RepatchBuffer&, StructureStubInfo&) { RELEASE_ASSERT_NOT_REACHED(); }
    6464
    6565} } // namespace JSC::DFG
  • trunk/Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h

    r146459 r146831  
    3636#define OFFLINE_ASM_C_LOOP 1
    3737#define OFFLINE_ASM_X86 0
     38#define OFFLINE_ASM_ARM 0
    3839#define OFFLINE_ASM_ARMv7 0
     40#define OFFLINE_ASM_ARMv7_TRADITIONAL 0
    3941#define OFFLINE_ASM_X86_64 0
    4042#define OFFLINE_ASM_ARMv7s 0
  • trunk/Source/JavaScriptCore/offlineasm/cloop.rb

    r145551 r146831  
    466466    $asm.putc "{"
    467467    $asm.putc "    #{tempType} temp = #{op2} #{operator} #{op1};"
     468    $asm.putc "    #{op2} = temp;"
    468469    $asm.putc "    if (temp #{conditionTest})"
    469470    $asm.putc "        goto  #{operands[2].cLabel};"
    470     $asm.putc "    #{op2} = temp;"
    471471    $asm.putc "}"
    472472end
     
    534534    end
    535535
    536     $asm.putc "    if #{overflowTest} {"
     536    $asm.putc "    bool didOverflow = #{overflowTest};"
     537    $asm.putc "    #{operands[1].clValue(type)} = #{operands[1].clValue(type)} #{operator} #{operands[0].clValue(type)};"
     538    $asm.putc "    if (didOverflow)"
    537539    $asm.putc "        goto #{operands[2].cLabel};"
    538     $asm.putc "    }"
    539     $asm.putc "    #{operands[1].clValue(type)} = #{operands[1].clValue(type)} #{operator} #{operands[0].clValue(type)};"
    540540    $asm.putc "}"
    541541end
Note: See TracChangeset for help on using the changeset viewer.