]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - offlineasm/instructions.rb
JavaScriptCore-7600.1.4.9.tar.gz
[apple/javascriptcore.git] / offlineasm / instructions.rb
index 10647bdf5de13c9993454b13271e298d4e86daa8..44280e776b1ce2a563bbd366d37281f1ed3b3032 100644 (file)
@@ -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/