add basic JIT using xbyak

Long term we'll need to spin up our own codegen rather than using xbyak,
since it uses exceptions and does not support ARM.

I really don't like how I've hacked in the caching of the JITted
program, but that'll change anyway when switching away from xbyak.

Performance looks good, better than (lowp) SkRasterPipeline
but not quite as good as hand-tuned code:

  Opts:     0.2 ns/px
  RP:       0.7
  F32:      0.8
  I32:      0.6
  I32_SWAR: 0.5

ninja -C out dm nanobench && out/dm -m SkVM && gobjdump -D -b binary -mi386:x86-64 /tmp/code.bin --insn-width=10

Change-Id: I34ce46e1d3fe5aa75f42709049a92ac79bf48bbd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219341
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
diff --git a/BUILD.gn b/BUILD.gn
index f8453fe..a8e617d 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -37,6 +37,7 @@
   skia_use_metal = false
   skia_use_libheif = is_skia_dev_build
   skia_use_x11 = is_linux
+  skia_use_xbyak = false
   skia_use_xps = true
 
   skia_android_serial = ""
@@ -817,6 +818,15 @@
   ]
 }
 
+optional("skvm_jit") {
+  enabled = skia_use_xbyak
+  public_defines = [ "SKVM_JIT" ]
+
+  public_deps = [
+    "//third_party/xbyak",
+  ]
+}
+
 if (skia_enable_gpu && skia_generate_workarounds) {
   action("workaround_list") {
     script = "tools/build_workaround_header.py"
@@ -875,6 +885,7 @@
     ":none",
     ":png",
     ":raw",
+    ":skvm_jit",
     ":sse2",
     ":sse41",
     ":sse42",