Changeset 228739 in webkit


Ignore:
Timestamp:
Feb 19, 2018 11:34:30 PM (6 years ago)
Author:
Carlos Garcia Campos
Message:

Merge r228402 - Miscellaneous refactoring of offlineasm.
https://bugs.webkit.org/show_bug.cgi?id=182702
<rdar://problem/37467887>

Reviewed by Filip Pizlo.

  1. Refactor out the emission of $asm.comment, $asm.codeOrigin, $asm.annotation, and $asm.debugAnnotation into a recordMetaData method. This standardizes how we emit this metadata and makes all backends do it the same way.
  1. Add the ability to include custom offlineasm scripts from WebKitAdditions in the future.
  • offlineasm/arm.rb:
  • offlineasm/arm64.rb:
  • offlineasm/ast.rb:
  • offlineasm/backends.rb:
  • offlineasm/cloop.rb:
  • offlineasm/config.rb:
  • offlineasm/mips.rb:
  • offlineasm/risc.rb:
  • offlineasm/x86.rb:
Location:
releases/WebKitGTK/webkit-2.20/Source/JavaScriptCore
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.20/Source/JavaScriptCore/ChangeLog

    r228738 r228739  
     12018-02-12  Mark Lam  <mark.lam@apple.com>
     2
     3        Miscellaneous refactoring of offlineasm.
     4        https://bugs.webkit.org/show_bug.cgi?id=182702
     5        <rdar://problem/37467887>
     6
     7        Reviewed by Filip Pizlo.
     8
     9        1. Refactor out the emission of $asm.comment, $asm.codeOrigin, $asm.annotation,
     10           and $asm.debugAnnotation into a recordMetaData method.  This standardizes how
     11           we emit this metadata and makes all backends do it the same way.
     12
     13        2. Add the ability to include custom offlineasm scripts from WebKitAdditions in
     14           the future.
     15
     16        * offlineasm/arm.rb:
     17        * offlineasm/arm64.rb:
     18        * offlineasm/ast.rb:
     19        * offlineasm/backends.rb:
     20        * offlineasm/cloop.rb:
     21        * offlineasm/config.rb:
     22        * offlineasm/mips.rb:
     23        * offlineasm/risc.rb:
     24        * offlineasm/x86.rb:
     25
    1262018-02-12  Saam Barati  <sbarati@apple.com>
    227
  • releases/WebKitGTK/webkit-2.20/Source/JavaScriptCore/offlineasm/arm.rb

    r214969 r228739  
    1 # Copyright (C) 2011, 2012, 2015-2016 Apple Inc. All rights reserved.
     1# Copyright (C) 2011-2018 Apple Inc. All rights reserved.
    22# Copyright (C) 2013 University of Szeged. All rights reserved.
    33#
     
    349349
    350350    def lowerARMCommon
    351         $asm.codeOrigin codeOriginString if $enableCodeOriginComments
    352         $asm.annotation annotation if $enableInstrAnnotations
    353         $asm.debugAnnotation codeOrigin.debugDirective if $enableDebugAnnotations
    354 
    355351        case opcode
    356352        when "addi", "addp", "addis", "addps"
  • releases/WebKitGTK/webkit-2.20/Source/JavaScriptCore/offlineasm/arm64.rb

    r227874 r228739  
    1 # Copyright (C) 2011, 2012, 2014-2016 Apple Inc. All rights reserved.
     1# Copyright (C) 2011-2018 Apple Inc. All rights reserved.
    22# Copyright (C) 2014 University of Szeged. All rights reserved.
    33#
     
    512512class Instruction
    513513    def lowerARM64
    514         $asm.comment codeOriginString
    515         $asm.annotation annotation if $enableInstrAnnotations
    516         $asm.debugAnnotation codeOrigin.debugDirective if $enableDebugAnnotations
    517 
    518514        case opcode
    519515        when 'addi'
  • releases/WebKitGTK/webkit-2.20/Source/JavaScriptCore/offlineasm/ast.rb

    r222549 r228739  
    1 # Copyright (C) 2011 Apple Inc. All rights reserved.
     1# Copyright (C) 2011-2018 Apple Inc. All rights reserved.
    22#
    33# Redistribution and use in source and binary forms, with or without
     
    934934        end
    935935    end
     936
     937    def prepareToLower(backendName)
     938        if respond_to?("recordMetaData#{backendName}")
     939            send("recordMetaData#{backendName}")
     940        else
     941            recordMetaDataDefault
     942        end
     943    end
     944
     945    def recordMetaDataDefault
     946        $asm.codeOrigin codeOriginString if $enableCodeOriginComments
     947        $asm.annotation annotation if $enableInstrAnnotations
     948        $asm.debugAnnotation codeOrigin.debugDirective if $enableDebugAnnotations
     949    end
    936950end
    937951
  • releases/WebKitGTK/webkit-2.20/Source/JavaScriptCore/offlineasm/backends.rb

    r220994 r228739  
    1 # Copyright (C) 2011, 2016 Apple Inc. All rights reserved.
     1# Copyright (C) 2011-2018 Apple Inc. All rights reserved.
    22#
    33# Redistribution and use in source and binary forms, with or without
     
    125125        begin
    126126            $activeBackend = name
    127             send("lower" + name)
     127            send("prepareToLower", name)
     128            send("lower#{name}")
    128129        rescue => e
    129130            raise LoweringError.new(e, codeOriginString)
  • releases/WebKitGTK/webkit-2.20/Source/JavaScriptCore/offlineasm/cloop.rb

    r227929 r228739  
    1 # Copyright (C) 2012-2017 Apple Inc. All rights reserved.
     1# Copyright (C) 2012-2018 Apple Inc. All rights reserved.
    22#
    33# Redistribution and use in source and binary forms, with or without
     
    568568
    569569    def lowerC_LOOP
    570         $asm.codeOrigin codeOriginString if $enableCodeOriginComments
    571         $asm.annotation annotation if $enableInstrAnnotations && (opcode != "cloopDo")
    572 
    573570        case opcode
    574571        when "addi"
     
    11661163        end
    11671164    end
    1168 end
     1165
     1166    def recordMetaDataC_LOOP
     1167        $asm.codeOrigin codeOriginString if $enableCodeOriginComments
     1168        $asm.annotation annotation if $enableInstrAnnotations && (opcode != "cloopDo")
     1169        $asm.debugAnnotation codeOrigin.debugDirective if $enableDebugAnnotations
     1170    end
     1171end
  • releases/WebKitGTK/webkit-2.20/Source/JavaScriptCore/offlineasm/config.rb

    r216835 r228739  
    1 # Copyright (C) 2012, 2016 Apple Inc. All rights reserved.
     1# Copyright (C) 2012-2018 Apple Inc. All rights reserved.
    22#
    33# Redistribution and use in source and binary forms, with or without
     
    2121# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
    2222# THE POSSIBILITY OF SUCH DAMAGE.
     23
     24buildProductsDirectory = ENV['BUILT_PRODUCTS_DIR'];
     25if buildProductsDirectory and File.exists?(buildProductsDirectory)
     26    $: << "#{buildProductsDirectory}/usr/local/include/WebKitAdditions/Scripts"
     27end
     28sdkRootDirectory = ENV['SDKROOT'];
     29if sdkRootDirectory and File.exists?(sdkRootDirectory)
     30    $: << "#{sdkRootDirectory}/usr/local/include/WebKitAdditions/Scripts"
     31end
     32
    2333
    2434$preferredCommentStartColumn = 60
  • releases/WebKitGTK/webkit-2.20/Source/JavaScriptCore/offlineasm/mips.rb

    r198173 r228739  
    1 # Copyright (C) 2012 Apple Inc. All rights reserved.
     1# Copyright (C) 2012-2018 Apple Inc. All rights reserved.
    22# Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
    33#
     
    826826class Instruction
    827827    def lowerMIPS
    828         $asm.comment codeOriginString
    829828        case opcode
    830829        when "addi", "addp", "addis"
  • releases/WebKitGTK/webkit-2.20/Source/JavaScriptCore/offlineasm/risc.rb

    r213973 r228739  
    1 # Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
     1# Copyright (C) 2011-2018 Apple Inc. All rights reserved.
    22#
    33# Redistribution and use in source and binary forms, with or without
     
    576576            case node.opcode
    577577            when "noti", "notp"
    578                 raise "Wrong nubmer of operands at #{node.codeOriginString}" unless node.operands.size == 1
     578                raise "Wrong number of operands at #{node.codeOriginString}" unless node.operands.size == 1
    579579                suffix = node.opcode[-1..-1]
    580580                newList << Instruction.new(node.codeOrigin, "xor" + suffix,
  • releases/WebKitGTK/webkit-2.20/Source/JavaScriptCore/offlineasm/x86.rb

    r227874 r228739  
    1 # Copyright (C) 2012, 2014-2016 Apple Inc. All rights reserved.
     1# Copyright (C) 2012-2018 Apple Inc. All rights reserved.
    22# Copyright (C) 2013 Digia Plc. and/or its subsidiary(-ies)
    33#
     
    891891
    892892    def lowerX86Common
    893         $asm.codeOrigin codeOriginString if $enableCodeOriginComments
    894         $asm.annotation annotation if $enableInstrAnnotations
    895         $asm.debugAnnotation codeOrigin.debugDirective if $enableDebugAnnotations
    896 
    897893        case opcode
    898894        when "addi"
Note: See TracChangeset for help on using the changeset viewer.