Upgrade V8 to 5.1.281.57  DO NOT MERGE

FPIIM-449

Change-Id: Id981b686b4d587ac31697662eb98bb34be42ad90
(cherry picked from commit 3b9bc31999c9787eb726ecdbfd5796bfdec32a18)
diff --git a/BUILD.gn b/BUILD.gn
index 5f3baf2..28aca24 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -21,6 +21,12 @@
   # Enable the snapshot feature, for fast context creation.
   # http://v8project.blogspot.com/2015/09/custom-startup-snapshots.html
   v8_use_snapshot = true
+
+  # Similar to vfp but on MIPS.
+  v8_can_use_fpu_instructions = true
+
+  # Similar to the ARM hard float ABI but on MIPS.
+  v8_use_mips_abi_hardfloat = true
 }
 
 # TODO(jochen): These will need to be user-settable to support standalone V8
@@ -28,7 +34,7 @@
 v8_deprecation_warnings = false
 v8_enable_disassembler = false
 v8_enable_gdbjit = false
-v8_enable_handle_zapping = is_debug
+v8_enable_handle_zapping = false
 v8_enable_i18n_support = true
 v8_enable_verify_heap = false
 v8_interpreted_regexp = false
@@ -77,6 +83,11 @@
   include_dirs = [ "." ]
 }
 
+# This config should be applied to code using the libplatform.
+config("libplatform_config") {
+  include_dirs = [ "include" ]
+}
+
 # This config should only be applied to code using V8 and not any V8 code
 # itself.
 config("external_config") {
@@ -137,48 +148,93 @@
   defines = []
   cflags = []
 
-  # TODO(jochen): Add support for arm subarchs, mips, mipsel, mips64el.
-
   if (v8_target_arch == "arm") {
     defines += [ "V8_TARGET_ARCH_ARM" ]
-    if (current_cpu == "arm") {
-      if (arm_version == 7) {
-        defines += [ "CAN_USE_ARMV7_INSTRUCTIONS" ]
-      }
-      if (arm_fpu == "vfpv3-d16") {
-        defines += [ "CAN_USE_VFP3_INSTRUCTIONS" ]
-      } else if (arm_fpu == "vfpv3") {
-        defines += [
-          "CAN_USE_VFP3_INSTRUCTIONS",
-          "CAN_USE_VFP32DREGS",
-        ]
-      } else if (arm_fpu == "neon") {
-        defines += [
-          "CAN_USE_VFP3_INSTRUCTIONS",
-          "CAN_USE_VFP32DREGS",
-          "CAN_USE_NEON",
-        ]
-      }
-    } else {
-      # These defines ares used for the ARM simulator.
+    if (arm_version == 7) {
+      defines += [ "CAN_USE_ARMV7_INSTRUCTIONS" ]
+    }
+    if (arm_fpu == "vfpv3-d16") {
+      defines += [ "CAN_USE_VFP3_INSTRUCTIONS" ]
+    } else if (arm_fpu == "vfpv3") {
       defines += [
-        "CAN_USE_ARMV7_INSTRUCTIONS",
         "CAN_USE_VFP3_INSTRUCTIONS",
         "CAN_USE_VFP32DREGS",
-        "USE_EABI_HARDFLOAT=0",
+      ]
+    } else if (arm_fpu == "neon") {
+      defines += [
+        "CAN_USE_VFP3_INSTRUCTIONS",
+        "CAN_USE_VFP32DREGS",
+        "CAN_USE_NEON",
       ]
     }
-
     # TODO(jochen): Add support for arm_test_noprobe.
+
+    if (current_cpu != "arm") {
+      # These defines ares used for the ARM simulator.
+      if (arm_float_abi == "hard") {
+        defines += [ "USE_EABI_HARDFLOAT=1" ]
+      } else if (arm_float_abi == "softfp") {
+        defines += [ "USE_EABI_HARDFLOAT=0" ]
+      }
+    }
   }
   if (v8_target_arch == "arm64") {
     defines += [ "V8_TARGET_ARCH_ARM64" ]
   }
+  # TODO(jochen): Add support for mips.
   if (v8_target_arch == "mipsel") {
     defines += [ "V8_TARGET_ARCH_MIPS" ]
+    if (v8_can_use_fpu_instructions) {
+      defines += [ "CAN_USE_FPU_INSTRUCTIONS" ]
+    }
+    if (v8_use_mips_abi_hardfloat) {
+      defines += [
+        "__mips_hard_float=1",
+        "CAN_USE_FPU_INSTRUCTIONS",
+      ]
+    } else {
+      defines += [ "__mips_soft_float=1" ]
+    }
+    if (mips_arch_variant == "r6") {
+      defines += [
+        "_MIPS_ARCH_MIPS32R6",
+        "FPU_MODE_FP64",
+      ]
+    } else if (mips_arch_variant == "r2") {
+      defines += [ "_MIPS_ARCH_MIPS32R2" ]
+      if (mips_fpu_mode == "fp64") {
+        defines += [ "FPU_MODE_FP64" ]
+      } else if (mips_fpu_mode == "fpxx") {
+        defines += [ "FPU_MODE_FPXX" ]
+      } else if (mips_fpu_mode == "fp32") {
+        defines += [ "FPU_MODE_FP32" ]
+      }
+    } else if (mips_arch_variant == "r1") {
+      defines += [ "FPU_MODE_FP32" ]
+    }
+    # TODO(jochen): Add support for mips_arch_variant rx and loongson.
   }
+  # TODO(jochen): Add support for mips64.
   if (v8_target_arch == "mips64el") {
     defines += [ "V8_TARGET_ARCH_MIPS64" ]
+    if (v8_can_use_fpu_instructions) {
+      defines += [ "CAN_USE_FPU_INSTRUCTIONS" ]
+    }
+    # TODO(jochen): Add support for big endian host byteorder.
+    defines += [ "V8_TARGET_ARCH_MIPS64_LE" ]
+    if (v8_use_mips_abi_hardfloat) {
+      defines += [
+        "__mips_hard_float=1",
+        "CAN_USE_FPU_INSTRUCTIONS",
+      ]
+    } else {
+      defines += [ "__mips_soft_float=1" ]
+    }
+    if (mips_arch_variant == "r6") {
+      defines += [ "_MIPS_ARCH_MIPS64R6" ]
+    } else if (mips_arch_variant == "r2") {
+      defines += [ "_MIPS_ARCH_MIPS64R2" ]
+    }
   }
   if (v8_target_arch == "s390") {
     defines += [ "V8_TARGET_ARCH_S390" ]
@@ -227,8 +283,11 @@
 
   # The script depends on this other script, this rule causes a rebuild if it
   # changes.
-  inputs = [ "tools/jsmin.py" ]
+  inputs = [
+    "tools/jsmin.py",
+  ]
 
+  # NOSORT
   sources = [
     "src/js/macros.py",
     "src/messages.h",
@@ -257,6 +316,7 @@
     "src/js/string-iterator.js",
     "src/js/templates.js",
     "src/js/spread.js",
+    "src/js/proxy.js",
     "src/debug/mirrors.js",
     "src/debug/debug.js",
     "src/debug/liveedit.js",
@@ -291,21 +351,24 @@
 
   # The script depends on this other script, this rule causes a rebuild if it
   # changes.
-  inputs = [ "tools/jsmin.py" ]
+  inputs = [
+    "tools/jsmin.py",
+  ]
 
+  # NOSORT
   sources = [
     "src/js/macros.py",
     "src/messages.h",
-    "src/js/proxy.js",
     "src/js/generator.js",
     "src/js/harmony-atomics.js",
-    "src/js/harmony-regexp.js",
+    "src/js/harmony-regexp-exec.js",
     "src/js/harmony-object-observe.js",
     "src/js/harmony-sharedarraybuffer.js",
     "src/js/harmony-simd.js",
     "src/js/harmony-species.js",
     "src/js/harmony-unicode-regexps.js",
-    "src/js/promise-extra.js"
+    "src/js/harmony-string-padding.js",
+    "src/js/promise-extra.js",
   ]
 
   outputs = [
@@ -334,7 +397,9 @@
 
   # The script depends on this other script, this rule causes a rebuild if it
   # changes.
-  inputs = [ "tools/jsmin.py" ]
+  inputs = [
+    "tools/jsmin.py",
+  ]
 
   sources = v8_extra_library_files
 
@@ -343,8 +408,7 @@
   ]
 
   args = [
-           rebase_path("$target_gen_dir/extras-libraries.cc",
-                       root_build_dir),
+           rebase_path("$target_gen_dir/extras-libraries.cc", root_build_dir),
            "EXTRAS",
          ] + rebase_path(sources, root_build_dir)
 
@@ -364,7 +428,9 @@
 
   # The script depends on this other script, this rule causes a rebuild if it
   # changes.
-  inputs = [ "tools/jsmin.py" ]
+  inputs = [
+    "tools/jsmin.py",
+  ]
 
   sources = v8_experimental_extra_library_files
 
@@ -382,7 +448,8 @@
     outputs += [ "$target_gen_dir/libraries_experimental_extras.bin" ]
     args += [
       "--startup_blob",
-      rebase_path("$target_gen_dir/libraries_experimental_extras.bin", root_build_dir),
+      rebase_path("$target_gen_dir/libraries_experimental_extras.bin",
+                  root_build_dir),
     ]
   }
 }
@@ -392,6 +459,7 @@
 
   script = "tools/js2c.py"
 
+  # NOSORT
   inputs = [
     "src/d8.js",
     "src/js/macros.py",
@@ -425,10 +493,11 @@
     deps = [
       ":js2c",
       ":js2c_experimental",
-      ":js2c_extras",
       ":js2c_experimental_extras",
+      ":js2c_extras",
     ]
 
+    # NOSORT
     sources = [
       "$target_gen_dir/libraries.bin",
       "$target_gen_dir/libraries_experimental.bin",
@@ -456,6 +525,7 @@
 
   script = "tools/gen-postmortem-metadata.py"
 
+  # NOSORT
   sources = [
     "src/objects.h",
     "src/objects-inl.h",
@@ -486,9 +556,6 @@
     "./" + rebase_path(get_label_info(":mksnapshot($snapshot_toolchain)",
                                       "root_out_dir") + "/mksnapshot",
                        root_build_dir),
-    "--log-snapshot-positions",
-    "--logfile",
-    rebase_path("$target_gen_dir/snapshot.log", root_build_dir),
     "--startup_src",
     rebase_path("$target_gen_dir/snapshot.cc", root_build_dir),
   ]
@@ -519,16 +586,16 @@
   deps = [
     ":js2c",
     ":js2c_experimental",
-    ":js2c_extras",
     ":js2c_experimental_extras",
+    ":js2c_extras",
     ":v8_base",
   ]
 
   sources = [
-    "$target_gen_dir/libraries.cc",
+    "$target_gen_dir/experimental-extras-libraries.cc",
     "$target_gen_dir/experimental-libraries.cc",
     "$target_gen_dir/extras-libraries.cc",
-    "$target_gen_dir/experimental-extras-libraries.cc",
+    "$target_gen_dir/libraries.cc",
     "src/snapshot/snapshot-empty.cc",
   ]
 
@@ -552,8 +619,8 @@
   deps = [
     ":js2c",
     ":js2c_experimental",
-    ":js2c_extras",
     ":js2c_experimental_extras",
+    ":js2c_extras",
     ":v8_base",
   ]
   public_deps = [
@@ -563,10 +630,10 @@
   ]
 
   sources = [
-    "$target_gen_dir/libraries.cc",
+    "$target_gen_dir/experimental-extras-libraries.cc",
     "$target_gen_dir/experimental-libraries.cc",
     "$target_gen_dir/extras-libraries.cc",
-    "$target_gen_dir/experimental-extras-libraries.cc",
+    "$target_gen_dir/libraries.cc",
     "$target_gen_dir/snapshot.cc",
   ]
 
@@ -586,8 +653,8 @@
     deps = [
       ":js2c",
       ":js2c_experimental",
-      ":js2c_extras",
       ":js2c_experimental_extras",
+      ":js2c_extras",
       ":v8_base",
     ]
     public_deps = [
@@ -629,22 +696,24 @@
     "src/accessors.h",
     "src/address-map.cc",
     "src/address-map.h",
-    "src/allocation.cc",
-    "src/allocation.h",
     "src/allocation-site-scopes.cc",
     "src/allocation-site-scopes.h",
-    "src/api.cc",
-    "src/api.h",
+    "src/allocation.cc",
+    "src/allocation.h",
+    "src/api-arguments.cc",
+    "src/api-arguments.h",
     "src/api-experimental.cc",
     "src/api-experimental.h",
     "src/api-natives.cc",
     "src/api-natives.h",
+    "src/api.cc",
+    "src/api.h",
     "src/arguments.cc",
     "src/arguments.h",
     "src/assembler.cc",
     "src/assembler.h",
-    "src/assert-scope.h",
     "src/assert-scope.cc",
+    "src/assert-scope.h",
     "src/ast/ast-expression-rewriter.cc",
     "src/ast/ast-expression-rewriter.h",
     "src/ast/ast-expression-visitor.cc",
@@ -684,27 +753,30 @@
     "src/bootstrapper.h",
     "src/builtins.cc",
     "src/builtins.h",
-    "src/cancelable-task.cc",
-    "src/cancelable-task.h",
     "src/cached-powers.cc",
     "src/cached-powers.h",
-    "src/char-predicates.cc",
+    "src/cancelable-task.cc",
+    "src/cancelable-task.h",
     "src/char-predicates-inl.h",
+    "src/char-predicates.cc",
     "src/char-predicates.h",
     "src/checks.h",
     "src/code-factory.cc",
     "src/code-factory.h",
+    "src/code-stubs-hydrogen.cc",
     "src/code-stubs.cc",
     "src/code-stubs.h",
-    "src/code-stubs-hydrogen.cc",
     "src/codegen.cc",
     "src/codegen.h",
+    "src/collector.h",
     "src/compilation-cache.cc",
     "src/compilation-cache.h",
     "src/compilation-dependencies.cc",
     "src/compilation-dependencies.h",
     "src/compilation-statistics.cc",
     "src/compilation-statistics.h",
+    "src/compiler.cc",
+    "src/compiler.h",
     "src/compiler/access-builder.cc",
     "src/compiler/access-builder.h",
     "src/compiler/access-info.cc",
@@ -723,9 +795,9 @@
     "src/compiler/bytecode-branch-analysis.h",
     "src/compiler/bytecode-graph-builder.cc",
     "src/compiler/bytecode-graph-builder.h",
+    "src/compiler/c-linkage.cc",
     "src/compiler/change-lowering.cc",
     "src/compiler/change-lowering.h",
-    "src/compiler/c-linkage.cc",
     "src/compiler/coalesced-live-ranges.cc",
     "src/compiler/coalesced-live-ranges.h",
     "src/compiler/code-generator-impl.h",
@@ -748,18 +820,16 @@
     "src/compiler/dead-code-elimination.cc",
     "src/compiler/dead-code-elimination.h",
     "src/compiler/diamond.h",
-    "src/compiler/escape-analysis.cc",
-    "src/compiler/escape-analysis.h",
     "src/compiler/escape-analysis-reducer.cc",
     "src/compiler/escape-analysis-reducer.h",
-    "src/compiler/fast-accessor-assembler.cc",
-    "src/compiler/fast-accessor-assembler.h",
-    "src/compiler/frame.cc",
-    "src/compiler/frame.h",
+    "src/compiler/escape-analysis.cc",
+    "src/compiler/escape-analysis.h",
     "src/compiler/frame-elider.cc",
     "src/compiler/frame-elider.h",
     "src/compiler/frame-states.cc",
     "src/compiler/frame-states.h",
+    "src/compiler/frame.cc",
+    "src/compiler/frame.h",
     "src/compiler/gap-resolver.cc",
     "src/compiler/gap-resolver.h",
     "src/compiler/graph-reducer.cc",
@@ -800,10 +870,10 @@
     "src/compiler/js-global-object-specialization.h",
     "src/compiler/js-graph.cc",
     "src/compiler/js-graph.h",
-    "src/compiler/js-inlining.cc",
-    "src/compiler/js-inlining.h",
     "src/compiler/js-inlining-heuristic.cc",
     "src/compiler/js-inlining-heuristic.h",
+    "src/compiler/js-inlining.cc",
+    "src/compiler/js-inlining.h",
     "src/compiler/js-intrinsic-lowering.cc",
     "src/compiler/js-intrinsic-lowering.h",
     "src/compiler/js-native-context-specialization.cc",
@@ -822,9 +892,9 @@
     "src/compiler/liveness-analyzer.h",
     "src/compiler/load-elimination.cc",
     "src/compiler/load-elimination.h",
-    "src/compiler/loop-peeling.cc",
     "src/compiler/loop-analysis.cc",
     "src/compiler/loop-analysis.h",
+    "src/compiler/loop-peeling.cc",
     "src/compiler/machine-operator-reducer.cc",
     "src/compiler/machine-operator-reducer.h",
     "src/compiler/machine-operator.cc",
@@ -850,16 +920,16 @@
     "src/compiler/operator.h",
     "src/compiler/osr.cc",
     "src/compiler/osr.h",
-    "src/compiler/pipeline.cc",
-    "src/compiler/pipeline.h",
     "src/compiler/pipeline-statistics.cc",
     "src/compiler/pipeline-statistics.h",
+    "src/compiler/pipeline.cc",
+    "src/compiler/pipeline.h",
     "src/compiler/raw-machine-assembler.cc",
     "src/compiler/raw-machine-assembler.h",
-    "src/compiler/register-allocator.cc",
-    "src/compiler/register-allocator.h",
     "src/compiler/register-allocator-verifier.cc",
     "src/compiler/register-allocator-verifier.h",
+    "src/compiler/register-allocator.cc",
+    "src/compiler/register-allocator.h",
     "src/compiler/representation-change.cc",
     "src/compiler/representation-change.h",
     "src/compiler/schedule.cc",
@@ -895,8 +965,6 @@
     "src/compiler/wasm-linkage.cc",
     "src/compiler/zone-pool.cc",
     "src/compiler/zone-pool.h",
-    "src/compiler.cc",
-    "src/compiler.h",
     "src/context-measure.cc",
     "src/context-measure.h",
     "src/contexts-inl.h",
@@ -907,11 +975,11 @@
     "src/conversions.h",
     "src/counters.cc",
     "src/counters.h",
+    "src/crankshaft/compilation-phase.cc",
+    "src/crankshaft/compilation-phase.h",
     "src/crankshaft/hydrogen-alias-analysis.h",
     "src/crankshaft/hydrogen-bce.cc",
     "src/crankshaft/hydrogen-bce.h",
-    "src/crankshaft/hydrogen-bch.cc",
-    "src/crankshaft/hydrogen-bch.h",
     "src/crankshaft/hydrogen-canonicalize.cc",
     "src/crankshaft/hydrogen-canonicalize.h",
     "src/crankshaft/hydrogen-check-elimination.cc",
@@ -1011,12 +1079,16 @@
     "src/extensions/statistics-extension.h",
     "src/extensions/trigger-failure-extension.cc",
     "src/extensions/trigger-failure-extension.h",
+    "src/external-reference-table.cc",
+    "src/external-reference-table.h",
     "src/factory.cc",
     "src/factory.h",
+    "src/fast-accessor-assembler.cc",
+    "src/fast-accessor-assembler.h",
     "src/fast-dtoa.cc",
     "src/fast-dtoa.h",
-    "src/field-index.h",
     "src/field-index-inl.h",
+    "src/field-index.h",
     "src/field-type.cc",
     "src/field-type.h",
     "src/fixed-dtoa.cc",
@@ -1064,47 +1136,43 @@
     "src/heap/objects-visiting-inl.h",
     "src/heap/objects-visiting.cc",
     "src/heap/objects-visiting.h",
+    "src/heap/page-parallel-job.h",
     "src/heap/remembered-set.cc",
     "src/heap/remembered-set.h",
-    "src/heap/scavenge-job.h",
     "src/heap/scavenge-job.cc",
+    "src/heap/scavenge-job.h",
     "src/heap/scavenger-inl.h",
     "src/heap/scavenger.cc",
     "src/heap/scavenger.h",
     "src/heap/slot-set.h",
-    "src/heap/slots-buffer.cc",
-    "src/heap/slots-buffer.h",
     "src/heap/spaces-inl.h",
     "src/heap/spaces.cc",
     "src/heap/spaces.h",
-    "src/heap/store-buffer-inl.h",
     "src/heap/store-buffer.cc",
     "src/heap/store-buffer.h",
     "src/i18n.cc",
     "src/i18n.h",
-    "src/icu_util.cc",
-    "src/icu_util.h",
     "src/ic/access-compiler.cc",
     "src/ic/access-compiler.h",
     "src/ic/call-optimization.cc",
     "src/ic/call-optimization.h",
     "src/ic/handler-compiler.cc",
     "src/ic/handler-compiler.h",
+    "src/ic/ic-compiler.cc",
+    "src/ic/ic-compiler.h",
     "src/ic/ic-inl.h",
     "src/ic/ic-state.cc",
     "src/ic/ic-state.h",
     "src/ic/ic.cc",
     "src/ic/ic.h",
-    "src/ic/ic-compiler.cc",
-    "src/ic/ic-compiler.h",
     "src/ic/stub-cache.cc",
     "src/ic/stub-cache.h",
+    "src/icu_util.cc",
+    "src/icu_util.h",
     "src/identity-map.cc",
     "src/identity-map.h",
     "src/interface-descriptors.cc",
     "src/interface-descriptors.h",
-    "src/interpreter/bytecodes.cc",
-    "src/interpreter/bytecodes.h",
     "src/interpreter/bytecode-array-builder.cc",
     "src/interpreter/bytecode-array-builder.h",
     "src/interpreter/bytecode-array-iterator.cc",
@@ -1114,18 +1182,20 @@
     "src/interpreter/bytecode-register-allocator.cc",
     "src/interpreter/bytecode-register-allocator.h",
     "src/interpreter/bytecode-traits.h",
+    "src/interpreter/bytecodes.cc",
+    "src/interpreter/bytecodes.h",
     "src/interpreter/constant-array-builder.cc",
     "src/interpreter/constant-array-builder.h",
     "src/interpreter/control-flow-builders.cc",
     "src/interpreter/control-flow-builders.h",
     "src/interpreter/handler-table-builder.cc",
     "src/interpreter/handler-table-builder.h",
-    "src/interpreter/interpreter.cc",
-    "src/interpreter/interpreter.h",
     "src/interpreter/interpreter-assembler.cc",
     "src/interpreter/interpreter-assembler.h",
-    "src/interpreter/register-translator.cc",
-    "src/interpreter/register-translator.h",
+    "src/interpreter/interpreter-intrinsics.cc",
+    "src/interpreter/interpreter-intrinsics.h",
+    "src/interpreter/interpreter.cc",
+    "src/interpreter/interpreter.h",
     "src/interpreter/source-position-table.cc",
     "src/interpreter/source-position-table.h",
     "src/isolate-inl.h",
@@ -1133,8 +1203,8 @@
     "src/isolate.h",
     "src/json-parser.h",
     "src/json-stringifier.h",
-    "src/key-accumulator.h",
-    "src/key-accumulator.cc",
+    "src/keys.cc",
+    "src/keys.h",
     "src/layout-descriptor-inl.h",
     "src/layout-descriptor.cc",
     "src/layout-descriptor.h",
@@ -1147,9 +1217,9 @@
     "src/log.h",
     "src/lookup.cc",
     "src/lookup.h",
-    "src/macro-assembler.h",
     "src/machine-type.cc",
     "src/machine-type.h",
+    "src/macro-assembler.h",
     "src/messages.cc",
     "src/messages.h",
     "src/msan.h",
@@ -1188,6 +1258,8 @@
     "src/parsing/token.h",
     "src/pending-compilation-error-handler.cc",
     "src/pending-compilation-error-handler.h",
+    "src/perf-jit.cc",
+    "src/perf-jit.h",
     "src/profiler/allocation-tracker.cc",
     "src/profiler/allocation-tracker.h",
     "src/profiler/circular-queue-inl.h",
@@ -1279,19 +1351,29 @@
     "src/signature.h",
     "src/simulator.h",
     "src/small-pointer-list.h",
-    "src/snapshot/natives.h",
+    "src/snapshot/code-serializer.cc",
+    "src/snapshot/code-serializer.h",
+    "src/snapshot/deserializer.cc",
+    "src/snapshot/deserializer.h",
     "src/snapshot/natives-common.cc",
-    "src/snapshot/serialize.cc",
-    "src/snapshot/serialize.h",
+    "src/snapshot/natives.h",
+    "src/snapshot/partial-serializer.cc",
+    "src/snapshot/partial-serializer.h",
+    "src/snapshot/serializer-common.cc",
+    "src/snapshot/serializer-common.h",
+    "src/snapshot/serializer.cc",
+    "src/snapshot/serializer.h",
     "src/snapshot/snapshot-common.cc",
     "src/snapshot/snapshot-source-sink.cc",
     "src/snapshot/snapshot-source-sink.h",
-    "src/source-position.h",
-    "src/splay-tree.h",
-    "src/splay-tree-inl.h",
     "src/snapshot/snapshot.h",
-    "src/startup-data-util.h",
+    "src/snapshot/startup-serializer.cc",
+    "src/snapshot/startup-serializer.h",
+    "src/source-position.h",
+    "src/splay-tree-inl.h",
+    "src/splay-tree.h",
     "src/startup-data-util.cc",
+    "src/startup-data-util.h",
     "src/string-builder.cc",
     "src/string-builder.h",
     "src/string-search.h",
@@ -1299,6 +1381,8 @@
     "src/string-stream.h",
     "src/strtod.cc",
     "src/strtod.h",
+    "src/third_party/fdlibm/fdlibm.cc",
+    "src/third_party/fdlibm/fdlibm.h",
     "src/tracing/trace-event.cc",
     "src/tracing/trace-event.h",
     "src/transitions-inl.h",
@@ -1317,13 +1401,13 @@
     "src/typing-asm.h",
     "src/typing-reset.cc",
     "src/typing-reset.h",
-    "src/unicode-inl.h",
-    "src/unicode.cc",
-    "src/unicode.h",
     "src/unicode-cache-inl.h",
     "src/unicode-cache.h",
     "src/unicode-decoder.cc",
     "src/unicode-decoder.h",
+    "src/unicode-inl.h",
+    "src/unicode.cc",
+    "src/unicode.h",
     "src/utils-inl.h",
     "src/utils.cc",
     "src/utils.h",
@@ -1345,6 +1429,7 @@
     "src/wasm/encoder.h",
     "src/wasm/module-decoder.cc",
     "src/wasm/module-decoder.h",
+    "src/wasm/wasm-external-refs.h",
     "src/wasm/wasm-js.cc",
     "src/wasm/wasm-js.h",
     "src/wasm/wasm-macro-gen.h",
@@ -1354,26 +1439,24 @@
     "src/wasm/wasm-opcodes.h",
     "src/wasm/wasm-result.cc",
     "src/wasm/wasm-result.h",
-    "src/zone.cc",
-    "src/zone.h",
     "src/zone-allocator.h",
     "src/zone-containers.h",
-    "src/third_party/fdlibm/fdlibm.cc",
-    "src/third_party/fdlibm/fdlibm.h",
+    "src/zone.cc",
+    "src/zone.h",
   ]
 
   if (v8_target_arch == "x86") {
     sources += [
+      "src/compiler/ia32/code-generator-ia32.cc",
+      "src/compiler/ia32/instruction-codes-ia32.h",
+      "src/compiler/ia32/instruction-scheduler-ia32.cc",
+      "src/compiler/ia32/instruction-selector-ia32.cc",
       "src/crankshaft/ia32/lithium-codegen-ia32.cc",
       "src/crankshaft/ia32/lithium-codegen-ia32.h",
       "src/crankshaft/ia32/lithium-gap-resolver-ia32.cc",
       "src/crankshaft/ia32/lithium-gap-resolver-ia32.h",
       "src/crankshaft/ia32/lithium-ia32.cc",
       "src/crankshaft/ia32/lithium-ia32.h",
-      "src/compiler/ia32/code-generator-ia32.cc",
-      "src/compiler/ia32/instruction-codes-ia32.h",
-      "src/compiler/ia32/instruction-scheduler-ia32.cc",
-      "src/compiler/ia32/instruction-selector-ia32.cc",
       "src/debug/ia32/debug-ia32.cc",
       "src/full-codegen/ia32/full-codegen-ia32.cc",
       "src/ia32/assembler-ia32-inl.h",
@@ -1394,8 +1477,8 @@
       "src/ia32/macro-assembler-ia32.h",
       "src/ic/ia32/access-compiler-ia32.cc",
       "src/ic/ia32/handler-compiler-ia32.cc",
-      "src/ic/ia32/ic-ia32.cc",
       "src/ic/ia32/ic-compiler-ia32.cc",
+      "src/ic/ia32/ic-ia32.cc",
       "src/ic/ia32/stub-cache-ia32.cc",
       "src/regexp/ia32/regexp-macro-assembler-ia32.cc",
       "src/regexp/ia32/regexp-macro-assembler-ia32.h",
@@ -1416,8 +1499,8 @@
       "src/full-codegen/x64/full-codegen-x64.cc",
       "src/ic/x64/access-compiler-x64.cc",
       "src/ic/x64/handler-compiler-x64.cc",
-      "src/ic/x64/ic-x64.cc",
       "src/ic/x64/ic-compiler-x64.cc",
+      "src/ic/x64/ic-x64.cc",
       "src/ic/x64/stub-cache-x64.cc",
       "src/regexp/x64/regexp-macro-assembler-x64.cc",
       "src/regexp/x64/regexp-macro-assembler-x64.h",
@@ -1448,8 +1531,8 @@
       "src/arm/code-stubs-arm.h",
       "src/arm/codegen-arm.cc",
       "src/arm/codegen-arm.h",
-      "src/arm/constants-arm.h",
       "src/arm/constants-arm.cc",
+      "src/arm/constants-arm.h",
       "src/arm/cpu-arm.cc",
       "src/arm/deoptimizer-arm.cc",
       "src/arm/disasm-arm.cc",
@@ -1483,19 +1566,19 @@
     ]
   } else if (v8_target_arch == "arm64") {
     sources += [
+      "src/arm64/assembler-arm64-inl.h",
       "src/arm64/assembler-arm64.cc",
       "src/arm64/assembler-arm64.h",
-      "src/arm64/assembler-arm64-inl.h",
       "src/arm64/builtins-arm64.cc",
-      "src/arm64/codegen-arm64.cc",
-      "src/arm64/codegen-arm64.h",
       "src/arm64/code-stubs-arm64.cc",
       "src/arm64/code-stubs-arm64.h",
+      "src/arm64/codegen-arm64.cc",
+      "src/arm64/codegen-arm64.h",
       "src/arm64/constants-arm64.h",
       "src/arm64/cpu-arm64.cc",
+      "src/arm64/decoder-arm64-inl.h",
       "src/arm64/decoder-arm64.cc",
       "src/arm64/decoder-arm64.h",
-      "src/arm64/decoder-arm64-inl.h",
       "src/arm64/deoptimizer-arm64.cc",
       "src/arm64/disasm-arm64.cc",
       "src/arm64/disasm-arm64.h",
@@ -1507,9 +1590,9 @@
       "src/arm64/instrument-arm64.h",
       "src/arm64/interface-descriptors-arm64.cc",
       "src/arm64/interface-descriptors-arm64.h",
+      "src/arm64/macro-assembler-arm64-inl.h",
       "src/arm64/macro-assembler-arm64.cc",
       "src/arm64/macro-assembler-arm64.h",
-      "src/arm64/macro-assembler-arm64-inl.h",
       "src/arm64/simulator-arm64.cc",
       "src/arm64/simulator-arm64.h",
       "src/arm64/utils-arm64.cc",
@@ -1518,9 +1601,9 @@
       "src/compiler/arm64/instruction-codes-arm64.h",
       "src/compiler/arm64/instruction-scheduler-arm64.cc",
       "src/compiler/arm64/instruction-selector-arm64.cc",
+      "src/crankshaft/arm64/delayed-masm-arm64-inl.h",
       "src/crankshaft/arm64/delayed-masm-arm64.cc",
       "src/crankshaft/arm64/delayed-masm-arm64.h",
-      "src/crankshaft/arm64/delayed-masm-arm64-inl.h",
       "src/crankshaft/arm64/lithium-arm64.cc",
       "src/crankshaft/arm64/lithium-arm64.h",
       "src/crankshaft/arm64/lithium-codegen-arm64.cc",
@@ -1553,17 +1636,17 @@
       "src/full-codegen/mips/full-codegen-mips.cc",
       "src/ic/mips/access-compiler-mips.cc",
       "src/ic/mips/handler-compiler-mips.cc",
-      "src/ic/mips/ic-mips.cc",
       "src/ic/mips/ic-compiler-mips.cc",
+      "src/ic/mips/ic-mips.cc",
       "src/ic/mips/stub-cache-mips.cc",
+      "src/mips/assembler-mips-inl.h",
       "src/mips/assembler-mips.cc",
       "src/mips/assembler-mips.h",
-      "src/mips/assembler-mips-inl.h",
       "src/mips/builtins-mips.cc",
-      "src/mips/codegen-mips.cc",
-      "src/mips/codegen-mips.h",
       "src/mips/code-stubs-mips.cc",
       "src/mips/code-stubs-mips.h",
+      "src/mips/codegen-mips.cc",
+      "src/mips/codegen-mips.h",
       "src/mips/constants-mips.cc",
       "src/mips/constants-mips.h",
       "src/mips/cpu-mips.cc",
@@ -1595,17 +1678,17 @@
       "src/full-codegen/mips64/full-codegen-mips64.cc",
       "src/ic/mips64/access-compiler-mips64.cc",
       "src/ic/mips64/handler-compiler-mips64.cc",
-      "src/ic/mips64/ic-mips64.cc",
       "src/ic/mips64/ic-compiler-mips64.cc",
+      "src/ic/mips64/ic-mips64.cc",
       "src/ic/mips64/stub-cache-mips64.cc",
+      "src/mips64/assembler-mips64-inl.h",
       "src/mips64/assembler-mips64.cc",
       "src/mips64/assembler-mips64.h",
-      "src/mips64/assembler-mips64-inl.h",
       "src/mips64/builtins-mips64.cc",
-      "src/mips64/codegen-mips64.cc",
-      "src/mips64/codegen-mips64.h",
       "src/mips64/code-stubs-mips64.cc",
       "src/mips64/code-stubs-mips64.h",
+      "src/mips64/codegen-mips64.cc",
+      "src/mips64/codegen-mips64.h",
       "src/mips64/constants-mips64.cc",
       "src/mips64/constants-mips64.h",
       "src/mips64/cpu-mips64.cc",
@@ -1621,6 +1704,48 @@
       "src/regexp/mips64/regexp-macro-assembler-mips64.cc",
       "src/regexp/mips64/regexp-macro-assembler-mips64.h",
     ]
+  } else if (v8_target_arch == "s390" || v8_target_arch == "s390x") {
+    sources += [
+      "src/compiler/s390/code-generator-s390.cc",
+      "src/compiler/s390/instruction-codes-s390.h",
+      "src/compiler/s390/instruction-scheduler-s390.cc",
+      "src/compiler/s390/instruction-selector-s390.cc",
+      "src/crankshaft/s390/lithium-codegen-s390.cc",
+      "src/crankshaft/s390/lithium-codegen-s390.h",
+      "src/crankshaft/s390/lithium-gap-resolver-s390.cc",
+      "src/crankshaft/s390/lithium-gap-resolver-s390.h",
+      "src/crankshaft/s390/lithium-s390.cc",
+      "src/crankshaft/s390/lithium-s390.h",
+      "src/debug/s390/debug-s390.cc",
+      "src/full-codegen/s390/full-codegen-s390.cc",
+      "src/ic/s390/access-compiler-s390.cc",
+      "src/ic/s390/handler-compiler-s390.cc",
+      "src/ic/s390/ic-compiler-s390.cc",
+      "src/ic/s390/ic-s390.cc",
+      "src/ic/s390/stub-cache-s390.cc",
+      "src/regexp/s390/regexp-macro-assembler-s390.cc",
+      "src/regexp/s390/regexp-macro-assembler-s390.h",
+      "src/s390/assembler-s390-inl.h",
+      "src/s390/assembler-s390.cc",
+      "src/s390/assembler-s390.h",
+      "src/s390/builtins-s390.cc",
+      "src/s390/code-stubs-s390.cc",
+      "src/s390/code-stubs-s390.h",
+      "src/s390/codegen-s390.cc",
+      "src/s390/codegen-s390.h",
+      "src/s390/constants-s390.cc",
+      "src/s390/constants-s390.h",
+      "src/s390/cpu-s390.cc",
+      "src/s390/deoptimizer-s390.cc",
+      "src/s390/disasm-s390.cc",
+      "src/s390/frames-s390.cc",
+      "src/s390/frames-s390.h",
+      "src/s390/interface-descriptors-s390.cc",
+      "src/s390/macro-assembler-s390.cc",
+      "src/s390/macro-assembler-s390.h",
+      "src/s390/simulator-s390.cc",
+      "src/s390/simulator-s390.h",
+    ]
   }
 
   configs -= [ "//build/config/compiler:chromium_code" ]
@@ -1671,14 +1796,16 @@
   visibility = [ ":*" ]  # Only targets in this file can depend on this.
 
   sources = [
+    "src/base/accounting-allocator.cc",
+    "src/base/accounting-allocator.h",
     "src/base/adapters.h",
     "src/base/atomicops.h",
     "src/base/atomicops_internals_arm64_gcc.h",
     "src/base/atomicops_internals_arm_gcc.h",
     "src/base/atomicops_internals_atomicword_compat.h",
     "src/base/atomicops_internals_mac.h",
-    "src/base/atomicops_internals_mips_gcc.h",
     "src/base/atomicops_internals_mips64_gcc.h",
+    "src/base/atomicops_internals_mips_gcc.h",
     "src/base/atomicops_internals_portable.h",
     "src/base/atomicops_internals_s390_gcc.h",
     "src/base/atomicops_internals_tsan.h",
@@ -1702,16 +1829,16 @@
     "src/base/macros.h",
     "src/base/once.cc",
     "src/base/once.h",
-    "src/base/platform/elapsed-timer.h",
-    "src/base/platform/time.cc",
-    "src/base/platform/time.h",
     "src/base/platform/condition-variable.cc",
     "src/base/platform/condition-variable.h",
+    "src/base/platform/elapsed-timer.h",
     "src/base/platform/mutex.cc",
     "src/base/platform/mutex.h",
     "src/base/platform/platform.h",
     "src/base/platform/semaphore.cc",
     "src/base/platform/semaphore.h",
+    "src/base/platform/time.cc",
+    "src/base/platform/time.h",
     "src/base/safe_conversions.h",
     "src/base/safe_conversions_impl.h",
     "src/base/safe_math.h",
@@ -1745,10 +1872,16 @@
   if (is_linux) {
     sources += [ "src/base/platform/platform-linux.cc" ]
 
-    libs = [ "dl", "rt" ]
+    libs = [
+      "dl",
+      "rt",
+    ]
   } else if (is_android) {
     if (current_toolchain == host_toolchain) {
-      libs = [ "dl", "rt" ]
+      libs = [
+        "dl",
+        "rt",
+      ]
       if (host_os == "mac") {
         sources += [ "src/base/platform/platform-macos.cc" ]
       } else {
@@ -1818,6 +1951,7 @@
   configs += [ "//build/config/compiler:no_chromium_code" ]
   configs += [
     ":internal_config_base",
+    ":libplatform_config",
     ":features",
     ":toolchain",
   ]
@@ -1844,6 +1978,7 @@
     configs += [ "//build/config/compiler:no_chromium_code" ]
     configs += [
       ":internal_config",
+      ":libplatform_config",
       ":features",
       ":toolchain",
     ]
@@ -1933,9 +2068,7 @@
     }
 
     if (!is_component_build) {
-      sources += [
-        "$target_gen_dir/d8-js.cc",
-      ]
+      sources += [ "$target_gen_dir/d8-js.cc" ]
     }
     if (v8_enable_i18n_support) {
       deps += [ "//third_party/icu" ]
@@ -1956,6 +2089,7 @@
   configs += [ "//build/config/compiler:no_chromium_code" ]
   configs += [
     ":internal_config",
+    ":libplatform_config",
     ":features",
     ":toolchain",
   ]
@@ -1974,6 +2108,7 @@
   configs += [ "//build/config/compiler:no_chromium_code" ]
   configs += [
     ":internal_config",
+    ":libplatform_config",
     ":features",
     ":toolchain",
   ]
@@ -1992,6 +2127,45 @@
   configs += [ "//build/config/compiler:no_chromium_code" ]
   configs += [
     ":internal_config",
+    ":libplatform_config",
+    ":features",
+    ":toolchain",
+  ]
+}
+
+source_set("wasm_fuzzer") {
+  sources = [
+    "test/fuzzer/wasm.cc",
+  ]
+
+  deps = [
+    ":fuzzer_support",
+  ]
+
+  configs -= [ "//build/config/compiler:chromium_code" ]
+  configs += [ "//build/config/compiler:no_chromium_code" ]
+  configs += [
+    ":internal_config",
+    ":libplatform_config",
+    ":features",
+    ":toolchain",
+  ]
+}
+
+source_set("wasm_asmjs_fuzzer") {
+  sources = [
+    "test/fuzzer/wasm-asmjs.cc",
+  ]
+
+  deps = [
+    ":fuzzer_support",
+  ]
+
+  configs -= [ "//build/config/compiler:chromium_code" ]
+  configs += [ "//build/config/compiler:no_chromium_code" ]
+  configs += [
+    ":internal_config",
+    ":libplatform_config",
     ":features",
     ":toolchain",
   ]