Changeset 146459 in webkit


Ignore:
Timestamp:
Mar 21, 2013 6:19:40 AM (11 years ago)
Author:
rgabor@webkit.org
Message:

Implement LLInt for CPU(ARM_TRADITIONAL)
https://bugs.webkit.org/show_bug.cgi?id=97589

Reviewed by Zoltan Herczeg.

Enable LLInt for ARMv5 and ARMv7 traditional as well.

Source/JavaScriptCore:

  • llint/LLIntOfflineAsmConfig.h:
  • llint/LowLevelInterpreter.asm:
  • llint/LowLevelInterpreter32_64.asm:
  • offlineasm/arm.rb:
  • offlineasm/backends.rb:
  • offlineasm/instructions.rb:

Source/WTF:

  • wtf/Platform.h:
Location:
trunk/Source
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r146429 r146459  
     12013-03-21  Gabor Rapcsanyi  <rgabor@webkit.org>
     2
     3        Implement LLInt for CPU(ARM_TRADITIONAL)
     4        https://bugs.webkit.org/show_bug.cgi?id=97589
     5
     6        Reviewed by Zoltan Herczeg.
     7
     8        Enable LLInt for ARMv5 and ARMv7 traditional as well.
     9
     10        * llint/LLIntOfflineAsmConfig.h:
     11        * llint/LowLevelInterpreter.asm:
     12        * llint/LowLevelInterpreter32_64.asm:
     13        * offlineasm/arm.rb:
     14        * offlineasm/backends.rb:
     15        * offlineasm/instructions.rb:
     16
    1172013-03-20  Cosmin Truta  <ctruta@blackberry.com>
    218
  • trunk/Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h

    r138970 r146459  
    6161#else
    6262#define OFFLINE_ASM_ARMv7 0
     63#endif
     64
     65#if CPU(ARM_TRADITIONAL)
     66#if WTF_ARM_ARCH_AT_LEAST(7)
     67#define OFFLINE_ASM_ARMv7_TRADITIONAL 1
     68#define OFFLINE_ASM_ARM 0
     69#else
     70#define OFFLINE_ASM_ARM 1
     71#define OFFLINE_ASM_ARMv7_TRADITIONAL 0
     72#endif
     73#else
     74#define OFFLINE_ASM_ARMv7_TRADITIONAL 0
     75#define OFFLINE_ASM_ARM 0
    6376#endif
    6477
  • trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm

    r142769 r146459  
    183183
    184184macro preserveReturnAddressAfterCall(destinationRegister)
    185     if C_LOOP or ARMv7 or MIPS
     185    if C_LOOP or ARM or ARMv7 or ARMv7_TRADITIONAL or MIPS
    186186        # In C_LOOP case, we're only preserving the bytecode vPC.
    187187        move lr, destinationRegister
     
    194194
    195195macro restoreReturnAddressBeforeReturn(sourceRegister)
    196     if C_LOOP or ARMv7 or MIPS
     196    if C_LOOP or ARM or ARMv7 or ARMv7_TRADITIONAL or MIPS
    197197        # In C_LOOP case, we're only restoring the bytecode vPC.
    198198        move sourceRegister, lr
  • trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm

    r145000 r146459  
    106106
    107107macro cCall2(function, arg1, arg2)
    108     if ARMv7
     108    if ARM or ARMv7 or ARMv7_TRADITIONAL
    109109        move arg1, t0
    110110        move arg2, t1
     
    127127# This barely works. arg3 and arg4 should probably be immediates.
    128128macro cCall4(function, arg1, arg2, arg3, arg4)
    129     if ARMv7
     129    if ARM or ARMv7 or ARMv7_TRADITIONAL
    130130        move arg1, t0
    131131        move arg2, t1
     
    18921892        addp 16 - 4, sp
    18931893        loadp JITStackFrame::globalData + 4[sp], t3
    1894     elsif ARMv7
     1894    elsif ARM or ARMv7 or ARMv7_TRADITIONAL
    18951895        loadp JITStackFrame::globalData[sp], t3
    18961896        storep cfr, JSGlobalData::topCallFrame[t3]
  • trunk/Source/JavaScriptCore/offlineasm/arm.rb

    r145504 r146459  
    11# Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
     2# Copyright (C) 2013 University of Szeged. All rights reserved.
    23#
    34# Redistribution and use in source and binary forms, with or without
     
    2728require "risc"
    2829
     30def isARMv7
     31    case $activeBackend
     32    when "ARMv7"
     33        true
     34    when "ARMv7_TRADITIONAL", "ARM"
     35        false
     36    else
     37        raise "bad value for $activeBackend: #{$activeBackend}"
     38    end
     39end
     40
     41def isARMv7Traditional
     42    case $activeBackend
     43    when "ARMv7_TRADITIONAL"
     44        true
     45    when "ARMv7", "ARM"
     46        false
     47    else
     48        raise "bad value for $activeBackend: #{$activeBackend}"
     49    end
     50end
     51
    2952class Node
    3053    def armSingle
     
    4871    # Currently we only handle the simple cases, and fall back to mov/movt for the complex ones.
    4972    if value >= 0 && value < 256
    50         $asm.puts "movw #{register.armOperand}, \##{value}"
     73        $asm.puts "mov #{register.armOperand}, \##{value}"
    5174    elsif (~value) >= 0 && (~value) < 256
    5275        $asm.puts "mvn #{register.armOperand}, \##{~value}"
    53     else
     76    elsif isARMv7 or isARMv7Traditional
    5477        $asm.puts "movw #{register.armOperand}, \##{value & 0xffff}"
    5578        if (value & 0xffff0000) != 0
    5679            $asm.puts "movt #{register.armOperand}, \##{(value >> 16) & 0xffff}"
    5780        end
     81    else
     82        $asm.puts "ldr #{register.armOperand}, =#{value}"
    5883    end
    5984end
     
    151176    def armEmitLea(destination)
    152177        raise "Malformed BaseIndex, offset should be zero at #{codeOriginString}" unless offset.value == 0
    153         $asm.puts "add.w #{destination.armOperand}, #{base.armOperand}, #{index.armOperand}, lsl \##{scaleShift}"
     178        $asm.puts "add #{destination.armOperand}, #{base.armOperand}, #{index.armOperand}, lsl \##{scaleShift}"
    154179    end
    155180end
     
    162187
    163188class Sequence
     189    def getModifiedListARM
     190        raise unless $activeBackend == "ARM"
     191        getModifiedListARMCommon
     192    end
     193
    164194    def getModifiedListARMv7
     195        raise unless $activeBackend == "ARMv7"
     196        getModifiedListARMCommon
     197    end
     198
     199    def getModifiedListARMv7_TRADITIONAL
     200        raise unless $activeBackend == "ARMv7_TRADITIONAL"
     201        getModifiedListARMCommon
     202    end
     203
     204    def getModifiedListARMCommon
    165205        result = @list
    166206        result = riscLowerSimpleBranchOps(result)
     
    238278    if mask.immediate? and mask.value == -1
    239279        $asm.puts "tst #{value.armOperand}, #{value.armOperand}"
    240     elsif mask.immediate?
    241         $asm.puts "tst.w #{value.armOperand}, #{mask.armOperand}"
    242280    else
    243281        $asm.puts "tst #{value.armOperand}, #{mask.armOperand}"
     
    260298
    261299class Instruction
     300    def lowerARM
     301        raise unless $activeBackend == "ARM"
     302        lowerARMCommon
     303    end
     304
    262305    def lowerARMv7
     306        raise unless $activeBackend == "ARMv7"
     307        lowerARMCommon
     308    end
     309
     310    def lowerARMv7_TRADITIONAL
     311        raise unless $activeBackend == "ARMv7_TRADITIONAL"
     312        lowerARMCommon
     313    end
     314
     315    def lowerARMCommon
    263316        $asm.codeOrigin codeOriginString if $enableCodeOriginComments
    264317        $asm.annotation annotation if $enableInstrAnnotations
     
    467520                $asm.puts "mov pc, #{operands[0].armOperand}"
    468521            end
     522            if not isARMv7 and not isARMv7Traditional
     523                $asm.puts ".ltorg"
     524            end
    469525        when "call"
    470526            if operands[0].label?
  • trunk/Source/JavaScriptCore/offlineasm/backends.rb

    r145504 r146459  
    3333     "X86",
    3434     "X86_64",
     35     "ARM",
    3536     "ARMv7",
     37     "ARMv7_TRADITIONAL",
    3638     "MIPS",
    3739     "C_LOOP"
     
    4749     "X86",
    4850     "X86_64",
     51     "ARM",
    4952     "ARMv7",
     53     "ARMv7_TRADITIONAL",
    5054     "MIPS",
    5155     "C_LOOP"
  • trunk/Source/JavaScriptCore/offlineasm/instructions.rb

    r138970 r146459  
    258258    ]
    259259
    260 ARMv7_INSTRUCTIONS =
     260ARM_INSTRUCTIONS =
    261261    [
    262262     "smulli",
     
    292292    ]
    293293
    294 INSTRUCTIONS = MACRO_INSTRUCTIONS + X86_INSTRUCTIONS + ARMv7_INSTRUCTIONS + MIPS_INSTRUCTIONS + CXX_INSTRUCTIONS
     294INSTRUCTIONS = MACRO_INSTRUCTIONS + X86_INSTRUCTIONS + ARM_INSTRUCTIONS + MIPS_INSTRUCTIONS + CXX_INSTRUCTIONS
    295295
    296296INSTRUCTION_PATTERN = Regexp.new('\\A((' + INSTRUCTIONS.join(')|(') + '))\\Z')
  • trunk/Source/WTF/ChangeLog

    r146431 r146459  
     12013-03-21  Gabor Rapcsanyi  <rgabor@webkit.org>
     2
     3        Implement LLInt for CPU(ARM_TRADITIONAL)
     4        https://bugs.webkit.org/show_bug.cgi?id=97589
     5
     6        Reviewed by Zoltan Herczeg.
     7
     8        Enable LLInt for ARMv5 and ARMv7 traditional as well.
     9
     10        * wtf/Platform.h:
     11
    1122013-03-20  Sheriff Bot  <webkit.review.bot@gmail.com>
    213
  • trunk/Source/WTF/wtf/Platform.h

    r146320 r146459  
    786786    && (OS(DARWIN) || OS(LINUX)) \
    787787    && (PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(GTK) || PLATFORM(QT)) \
    788     && (CPU(X86) || CPU(X86_64) || CPU(ARM_THUMB2) || CPU(MIPS))
     788    && (CPU(X86) || CPU(X86_64) || CPU(ARM_THUMB2) || CPU(ARM_TRADITIONAL) || CPU(MIPS))
    789789#define ENABLE_LLINT 1
    790790#endif
Note: See TracChangeset for help on using the changeset viewer.