diff options
Diffstat (limited to 'Source/JavaScriptCore/offlineasm/instructions.rb')
-rw-r--r-- | Source/JavaScriptCore/offlineasm/instructions.rb | 46 |
1 files changed, 20 insertions, 26 deletions
diff --git a/Source/JavaScriptCore/offlineasm/instructions.rb b/Source/JavaScriptCore/offlineasm/instructions.rb index 5a3463fc9..bbfce7193 100644 --- a/Source/JavaScriptCore/offlineasm/instructions.rb +++ b/Source/JavaScriptCore/offlineasm/instructions.rb @@ -22,6 +22,7 @@ # THE POSSIBILITY OF SUCH DAMAGE. require "config" +require "set" # Interesting invariant, which we take advantage of: branching instructions # always begin with "b", and no non-branching instructions begin with "b". @@ -29,6 +30,7 @@ require "config" MACRO_INSTRUCTIONS = [ + "emit", "addi", "andi", "lshifti", @@ -247,8 +249,6 @@ MACRO_INSTRUCTIONS = "bnz", "leai", "leap", - "pushCalleeSaves", - "popCalleeSaves", "memfence" ] @@ -258,10 +258,16 @@ X86_INSTRUCTIONS = "idivi" ] +ARM_INSTRUCTIONS = + [ + "clrbp", + "mvlbl" + ] + ARM64_INSTRUCTIONS = [ - "popLRAndFP", # ARM64 requires registers to be pushed and popped in pairs, - "pushLRAndFP" # therefore we do LR (link register) and FP (frame pointer) together. + "pcrtoaddr", # Address from PC relative offset - adr instruction + "nopFixCortexA53Err835769" # nop on Cortex-A53 (nothing otherwise) ] RISC_INSTRUCTIONS = @@ -275,34 +281,22 @@ RISC_INSTRUCTIONS = MIPS_INSTRUCTIONS = [ + "la", "movz", "movn", + "setcallreg", "slt", "sltu", - "pichdr", - "pichdrra" - ] - -SH4_INSTRUCTIONS = - [ - "shllx", - "shlrx", - "shld", - "shad", - "bdnan", - "loaddReversedAndIncrementAddress", - "storedReversedAndDecrementAddress", - "ldspr", - "stspr", - "setargs" + "pichdr" ] CXX_INSTRUCTIONS = [ - "cloopCrash", # no operands - "cloopCallJSFunction", # operands: callee - "cloopCallNative", # operands: callee - "cloopCallSlowPath", # operands: callTarget, currentFrame, currentPC + "cloopCrash", # no operands + "cloopCallJSFunction", # operands: callee + "cloopCallNative", # operands: callee + "cloopCallSlowPath", # operands: callTarget, currentFrame, currentPC + "cloopCallSlowPathVoid", # operands: callTarget, currentFrame, currentPC # For debugging only: # Takes no operands but simply emits whatever follows in // comments as @@ -313,9 +307,9 @@ CXX_INSTRUCTIONS = "cloopDo", # no operands ] -INSTRUCTIONS = MACRO_INSTRUCTIONS + X86_INSTRUCTIONS + ARM64_INSTRUCTIONS + RISC_INSTRUCTIONS + MIPS_INSTRUCTIONS + SH4_INSTRUCTIONS + CXX_INSTRUCTIONS +INSTRUCTIONS = MACRO_INSTRUCTIONS + X86_INSTRUCTIONS + ARM_INSTRUCTIONS + ARM64_INSTRUCTIONS + RISC_INSTRUCTIONS + MIPS_INSTRUCTIONS + CXX_INSTRUCTIONS -INSTRUCTION_PATTERN = Regexp.new('\\A((' + INSTRUCTIONS.join(')|(') + '))\\Z') +INSTRUCTION_SET = INSTRUCTIONS.to_set def isBranch(instruction) instruction =~ /^b/ |