X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/4be4e30906bcb8ee30b4d189205cb70bad6707ce..81345200c95645a1b0d2635520f96ad55dfde63f:/offlineasm/instructions.rb diff --git a/offlineasm/instructions.rb b/offlineasm/instructions.rb index 10647bd..44280e7 100644 --- a/offlineasm/instructions.rb +++ b/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". @@ -206,8 +207,6 @@ MACRO_INSTRUCTIONS = "tqs", "tqz", "tqnz", - "peekq", - "pokeq", "bqeq", "bqneq", "bqa", @@ -249,13 +248,28 @@ MACRO_INSTRUCTIONS = "bnz", "leai", "leap", + "pushCalleeSaves", + "popCalleeSaves", + "memfence" ] X86_INSTRUCTIONS = [ "cdqi", - "idivi", - "resetX87Stack" + "idivi" + ] + +ARM_INSTRUCTIONS = + [ + "clrbp", + "mvlbl" + ] + +ARM64_INSTRUCTIONS = + [ + "pcrtoaddr", # Address from PC relative offset - adr instruction + "popLRAndFP", # ARM64 requires registers to be pushed and popped in pairs, + "pushLRAndFP" # therefore we do LR (link register) and FP (frame pointer) together. ] RISC_INSTRUCTIONS = @@ -279,6 +293,9 @@ MIPS_INSTRUCTIONS = SH4_INSTRUCTIONS = [ + "flushcp", + "alignformova", + "mova", "shllx", "shlrx", "shld", @@ -288,16 +305,16 @@ SH4_INSTRUCTIONS = "storedReversedAndDecrementAddress", "ldspr", "stspr", - "callf", - "jmpf" + "setargs" ] 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 @@ -308,9 +325,9 @@ CXX_INSTRUCTIONS = "cloopDo", # no operands ] -INSTRUCTIONS = MACRO_INSTRUCTIONS + X86_INSTRUCTIONS + RISC_INSTRUCTIONS + MIPS_INSTRUCTIONS + SH4_INSTRUCTIONS + CXX_INSTRUCTIONS +INSTRUCTIONS = MACRO_INSTRUCTIONS + X86_INSTRUCTIONS + ARM_INSTRUCTIONS + ARM64_INSTRUCTIONS + RISC_INSTRUCTIONS + MIPS_INSTRUCTIONS + SH4_INSTRUCTIONS + CXX_INSTRUCTIONS -INSTRUCTION_PATTERN = Regexp.new('\\A((' + INSTRUCTIONS.join(')|(') + '))\\Z') +INSTRUCTION_SET = INSTRUCTIONS.to_set def isBranch(instruction) instruction =~ /^b/